操作系统版本 | 硬件配置 | IP地址规划 | 主机名 | 虚拟机软件 | OpenStack版本 |
---|---|---|---|---|---|
centos7.9 | 4vCPUS/8G 30G硬盘 | 172.17.2.60/24 | openstack | VMware WorkStation16 | Stein |
centos7.9镜像获取地址:
链接:https://pan.baidu.com/s/11fxnAyr9xPinN2Yq56Ujxg
提取码:1314
OpenStack官方文档:https://docs.openstack.org/install-guide/
使用Packstack一键部署OpenStack的方式,隐藏了技术细节,如果使用中出来任何问题,我们都无法解决,所以体验完OpenStack的日常界面操作后,后期还是要仔细查看官方文档,然后一步步手工安装OpenStack各组件。
阿里云yum源设置官方文档:https://developer.aliyun.com/mirror/centos?spm=a2c6h.13651102.0.0.3e221b11Jpkdzb
hostnamectl set-hostname openstack
#注意修改自己的网卡配置文件
vi /etc/sysconfig/network-scripts/ifcfg-ens32
#重启网络服务
systemctl restart network
#验证IP地址
ip addr
echo "172.17.2.60 openstack" >> /etc/hosts
#验证修改结果
more /etc/hosts
#生成ssh密钥
ssh-keygen
#添加密钥信息到~./ssh/know_hosts文件
ssh-copy-id [email protected]
systemctl stop firewalld
systemctl disable firewalld
#查看防火墙状态
systemctl status firewalld
setenforce 0
sed -i 's/SELINUX=enforcing/SELINUX=disabled/' /etc/selinux/config
#c
systemctl status firewalld
getenforce
systemctl stop NetworkManager
systemctl disable NetworkManager
#查看NetworkManager状态
systemctl status NetworkManager
curl -o /etc/yum.repos.d/CentOS-Base.repo https://mirrors.aliyun.com/repo/Centos-7.repo
#重建本地yum索引缓存
yum makecache
#升级
yum -y update
#重启
reboot
yum -y install vim bash-completion yum-utils
OpenStack Stein
的yum
库yum -y install centos-release-openstack-stein
CentOS-OpenStack-stein.repo
配置文件cd /etc/yum.repos.d/
#备份
cp -a CentOS-OpenStack-stein.repo CentOS-OpenStack-stein.repo.bak
#修改配置文件
vim CentOS-OpenStack-stein.repo
[centos-openstack-stein]
baseurl=http://mirrors.aliyun.com/$contentdir/$releasever/cloud/$basearch/openstack-stein/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=cloud-openstack-stein
...
#清除本地yum索引缓存,然后再重建索引缓存
yum clean all && yum makecache
yum -y install openstack-packstack
packstack --allinone
自动化安装时间很长,静静等待,直到出现如下信息,表示成功安装。
**** Installation completed successfully ******
Additional information:
* Parameter CONFIG_NEUTRON_L2_AGENT: You have choosen OVN neutron backend. Note that this backend does not support LBaaS, VPNaaS or FWaaS services. Geneve will be used as encapsulation method for tenant networks
* A new answerfile was created in: /root/packstack-answers-20220222-171022.txt
* Time synchronization installation was skipped. Please note that unsynchronized time on server instances might be problem for some OpenStack components.
* File /root/keystonerc_admin has been created on OpenStack client host 172.17.2.60. To use the command line tools you need to source the file.
* To access the OpenStack Dashboard browse to http://172.17.2.60/dashboard .
Please, find your login credentials stored in the keystonerc_admin in your home directory.
* The installation log file is available at: /var/tmp/packstack/20220222-171021-YFXtB3/openstack-setup.log
* The generated manifests are available at: /var/tmp/packstack/20220222-171021-YFXtB3/manifests
cat keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin #Dashboard登录账号
export OS_PASSWORD='12b2ca7e963242ae' #Dashboard登录密码
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://172.17.2.60:5000/v3
export PS1='[\u@\h \W(keystone_admin)]\$ '
export OS_PROJECT_NAME=admin
export OS_USER_DOMAIN_NAME=Default
export OS_PROJECT_DOMAIN_NAME=Default
export OS_IDENTITY_API_VERSION=3
Dashboard web
登录界面Dashboard
登录密码为以后的实验过程,同时需要修改keystonerc_admin文件中的OS_PASSWORD变量,换成新密码,如下:
vim keystonerc_admin
export OS_PASSWORD='admin' #填入修改后的新密码
错误1:ERROR : Failed to run remote script, stdout:
stderr: Warning: Permanently added ‘172.17.2.60’ (ECDSA) to the list of known hosts.
解决办法:
ssh-kengen
ssh-copy-id [email protected]
错误2:facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory
原因:启用了epel库导致的
解决办法:
#1.禁用epel
yum-config-manager --disable epel
#2.清理yum索引缓存
yum clean all
#3.重建yum索引缓存
yum makecache
#4.降级leatherman
yum downgrade leatherman