1、准备工作
1.1、关闭selinux
y
SELINUX=disabled
检查:getenforce
1.2、关闭firewalld
systemctl status firewalld
systemctl stop firewalld
systemctl disable firewalld
systemctl status firewalld
1.3、关闭NetworkManager
systemctl stop NetworkManager
systemctl disable NetworkManager
1.4、设置NTP
yum -y install ntpdate ntp
rm -rf /etc/localtime
ln -s /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
或者
hwclock –hctosys #硬件时间同步到系统时间
2、安装基础包
2.1、安装epel,启用EPEL的repo源
yum -y install epel-release
2.2、安装相关软件
yum -y install python-devel libffi-devel gcc openssl-devel git python-pip libselinux-python
2.3、安装docker
安装过程略:
配置Docker共享挂载
mkdir -pv /etc/systemd/system/docker.service.d
vi /etc/systemd/system/docker.service.d/kolla.conf
[Service]
MountFlags=shared
3、安装kolla-ansible
3.1、 下载kolla-ansible的代码
cd /home
git clone https://github.com/openstack/kolla-ansible -b stable/queens
cd kolla-ansible
pip install --upgrade pip
pip install .
如果慢附上更改pip源方法:
# 更改pip镜像源
echo "---> update pip mirrors ..."
mkdir ~/.pip
echo """
[global]
trusted-host=mirrors.aliyun.com
index-url=http://mirrors.aliyun.com/pypi/simple/
""" >> ~/.pip/pip.conf
cat ~/.pip/pip.conf
3.2、复制相关文件
cp -r etc/kolla /etc/kolla/
cp ansible/inventory/* /home/
3.3、如果是虚拟化环境,还需要设置virt_type
mkdir -p /etc/kolla/config/nova
cat << EOF > /etc/kolla/config/nova/nova-compute.conf
[libvirt]
virt_type=qemu
cpu_mode = none
EOF
3.4、生成密码文件
kolla-genpwd
3.5、修改密码
vi /etc/kolla/passwords.yml
keystone_admin_password: openstack(dashboard密码)
3.6、编辑全局配置文件
vi /etc/kolla/globals.yml
检查配置:
cat /etc/kolla/globals.yml | grep -v “^#” | grep -v “^$”
3.7、安装ansible
yum -y install ansible
4、安装检查
检查
kolla-ansible prechecks -i /home/all-in-one
安装
kolla-ansible deploy -i /home/all-in-one
完全清理环境
kolla-ansible destroy -i /home/all-in-one --yes-i-really-really-mean-it
5、问题记录
5.1、error : virPidFileAcquirePath:422 : Failed to acquire pid file ‘/var/run/libvirtd.pid’: Resource temporarily unavailable
kolla安装的时候,关闭本机的libvirtd
systemctl stop libvirtd
5.2、Build of instance aborted: Failed to allocate the network(s), not rescheduling
root@compute1:~# vim /etc/nova/nova.conf
[DEFAULT]
vif_plugging_is_fatal = False
vif_plugging_timeout = 0