环境
CentOS 7
CPU核心数:2x2
RAM:8G
DISK:60G
问题说明
在安装openstack过程中,一直卡在下面过程:
Testing if puppet apply is finished: 192.168.100.132_controller.pp [ | ]
等待一会儿之后会报各种不同的错误,通过搜索问题,有让修改数据库授权的,有让修改hosts文件的,有让增大内存的,还有让升级某些组件的,问题是千奇百怪,解决方法是五花八门,但是最后都没有解决问题,但是,最后我通过修改安装源为阿里云的就成功了,最后怀疑可能是因为网络问题导致资源下载缓慢或者某些资源解析不到导致的(暂未得到证实,个人思考怀疑)。
安装步骤
- 修改主机名;
hostnamectl set-hostname controller
- 将IP与controller对应关系添加到hosts文件;
[root@controller ~]# vi /etc/hosts
127.0.0.1 localhost localhost.localdomain localhost4 localhost4.localdomain4
::1 localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.100.132 controller
- 修改网卡配置文件;
[root@controller ~]# vi /etc/sysconfig/network-scripts/ifcfg-ens33
TYPE=Ethernet
PROXY_METHOD=none
BROWSER_ONLY=no
BOOTPROTO=static
DEFROUTE=yes
IPV4_FAILURE_FATAL=no
NAME=ens33
UUID=3b1d07bf-d509-49f8-81a3-b4b16d7f190e
DEVICE=ens33
ONBOOT=yes
IPADDR=192.168.100.132 #配置静态IP
NETMASK=255.255.255.0
GATEWAY=192.168.100.2
DNS1=192.168.100.2 #配置DNS
- 重启网络服务;
systemctl restart network
- 下载阿里源;
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
- 重新生成缓存;
yum clean all && yum makecache
- 关闭防火墙;
systemctl stop firewalld && systemctl disable firewalld
- 编辑/etc/selinux/config的SELINUX改为disabled;
[root@controller ~]# vi /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=disabled #修改为disabled
# SELINUXTYPE= can take one of three values:
# targeted - Targeted processes are protected,
# minimum - Modification of targeted policy. Only selected processes are protected.
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
- 再次重启下网卡服务;
systemctl restart network
- 通过修改openstack的baseurl为阿里云地址;
[root@controller ~]# vi /etc/yum.repos.d/CentOS-OpenStack-rocky.repo
[centos-openstack-rocky]
name=CentOS-7 - OpenStack rocky
baseurl=https://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-rocky/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Cloud
exclude=sip,PyQt4
- 再配置一下QEMU的baseurl为阿里云地址;
[root@controller ~]# vi /etc/yum.repos.d/CentOS-QEMU-EV.repo
[centos-qemu-ev]
name=CentOS-$releasever - QEMU EV
baseurl=https://mirrors.aliyun.com/centos/7/virt/x86_64/kvm-common/
#mirrorlist=http://mirrorlist.centos.org/?release=$releasever&arch=$basearch&repo=virt-kvm-common
#baseurl=http://mirror.centos.org/$contentdir/$releasever/virt/$basearch/kvm-common/
gpgcheck=1
enabled=1
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-CentOS-SIG-Virtualization
- 下面正式开始安装openstack ;
yum install -y centos-release-openstack-rocky
yum -y update
yum install -y openstack-packstack
packstack --allinone
- 等待一会发现可以顺利安装,不再卡在 Testing if puppet apply is finished ,最后安装成功;
**** Installation completed successfully ******
- 在“家”目录有一个keystonerc_admin文件,执行如下;
source keystonerc_admin
openstack user list #测试一下是否有admin
- 查看admin密码;
[root@controller ~]# cat keystonerc_admin
unset OS_SERVICE_TOKEN
export OS_USERNAME=admin
export OS_PASSWORD='35292e4c7abc476f' #此为admin的密码
export OS_REGION_NAME=RegionOne
export OS_AUTH_URL=http://192.168.100.132: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
- 访问web端: http://192.168.100.132/dashboard/