packstack安装openstack

packstack安装openstack

1编辑好/etc/hosts
192.168.30.21 vm1
192.168.30.22 vm2

2确保关闭selinux
getenforce
防火墙使用trusted
firewall-cmd --set-default-zone=trusted

3获取yum 源
安装好wget
yum install wget -y

wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
wget -O /etc/yum.repos.d/epel-7-cloud.repo http://mirrors.aliyun.com/repo/epel-7-cloud.repo
wget -O /etc/yum.repos.d/epel-7.repo http://mirrors.aliyun.com/repo/epel-7.repo

##openstack需要较多的内存,内存不够安装可能会有报错,建议创建机器时候要在6G内存以上。
内存如果不够使用swap,如果swap不够则增加:
free -m
dd if=/dev/zero of=/tmp/newdisk bs=1M count=10240
du -sh /tmp/newdisk
mkswap -f /tmp/newdisk
chmod 0600 /tmp/newdisk
swapon /tmp/newdisk
echo 0 > /proc/sys/vm/swappiness
free -m

4 安装高版本的leatherman,否则在openstack-packstack时候会默认安装1.1.0版本,后续运行packstack会有报版本错误。
yum install leatherman-1.3.0 -y

5 安装openstack-packstack
yum install openstack-packstack -y

6 生成应答文件
packstack --gen-answer-file=test.txt

编辑应答文件,
vim test.txt
计算节点:
CONFIG_COMPUTE_HOSTS=192.168.30.21,192.168.30.22

sed -i ‘/^CONFIG_PROVISION_DEMO=/cCONFIG_PROVISION_DEMO=n’ test.txt
sed -i ‘/^CONFIG_NEUTRON_ML2_TYPE_DRIVERS=/cCONFIG_NEUTRON_ML2_TYPE_DRIVERS=flat,vxlan’ test.txt
sed -i ‘/^CONFIG_NEUTRON_ML2_FLAT_NETWORKS=/cCONFIG_NEUTRON_ML2_FLAT_NETWORKS=datacentre’ test.txt
sed -i ‘/^CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=/cCONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=datacentre:br-ex’ test.txt
sed -i.bak -r ‘s/(.+_PW)=[0-9a-z]+/\1=qwer1234/g’ test.txt

7 执行安装,耗时较久
packstack --answer-file=aa.txt

看到**** Installation completed successfully ******表示完成

8 完成后,如果有提示NetworkManager,关闭NetworkManager
systemctl stop NetworkManager
systemctl disable NetworkManager

9 如果忘记安装某个部件,重新编辑aa.txt,然后再跑一边即可。如安装heat:
CONFIG_HEAT_INSTALL=y
CONFIG_HEAT_DB_PW=qwer1234

你可能感兴趣的:(openstack,linux,openstack)