1. 192.168.72.60 os-control
  2. 192.168.72.59 os-nova01

服务器基础优化(每个节点都执行)

echo 'net.ipv4.ip_forward=1 ' >>/etc/sysctl.conf 
echo 'net.ipv4.tcp_tw_recycle=1 ' >>/etc/sysctl.conf
echo 'net.ipv4.tcp_tw_reuse=1 ' >>/etc/sysctl.conf 
sysctl -p
chmod +x /etc/rc.d/rc.local
yum install -y mlocate lrzsz tree vim nc nmap wget bash-completion bash-completion-extras cowsay sl htop iotop iftop lsof net-tools sysstat unzip bc psmisc ntpdate wc telnet-server bind-utils sshpass
echo '192.168.72.59  os-nova01' >>/etc/hosts
echo '192.168.72.60  0s-control' >>/etc/hosts
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
sed -i 's#SELINUX=enforcing#SELINUX=disabled#g' /etc/selinux/config
systemctl stop NetworkManager
systemctl disable NetworkManager
wget -O /etc/yum.repos.d/epel.repo http://mirrors.aliyun.com/repo/epel-7.repo
curl -o /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
yum install -y mlocate lrzsz tree vim nc nmap wget bash-completion bash-completion-extras cowsay sl htop iotop iftop lsof net-tools sysstat unzip bc psmisc ntpdate wc telnet-server bind-utils sshpass
sed -i 's#keepcache=0#keepcache=1#g' /etc/yum.conf
yum clean all       
yum makecache
ntpdate ntp1.aliyun.com
echo '*/30 * * * *  /sbin/ntpdate ntp1.aliyun.com >/dev/null 2>&1' >>/var/spool/cron/root

安装train版yum源(每个节点都执行)

yum install centos-release-openstack-train -y

检查源是否包含[base][updates][extras][centosplus][cloud][virt](每个节点都执行)

[base]
name=CentOS-$releasever - Base
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/os/$basearch/
gpgcheck=0
enabled=1

#released updates
[updates]
name=CentOS-$releasever - Updates
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/updates/$basearch/
gpgcheck=0
enabled=1

#additional packages that may be useful
[extras]
name=CentOS-$releasever - Extras
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/extras/$basearch/
gpgcheck=0
enabled=1

#additional packages that extend functionality of existing packages
[centosplus]
name=CentOS-$releasever - Plus
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/centosplus/$basearch/
gpgcheck=0
enabled=1

[cloud]
name=CentOS-$releasever - Cloud
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/cloud/$basearch/openstack-train/
gpgcheck=0
enabled=1

[virt]
name=CentOS-$releasever - Virt
baseurl=http://mirrors.tuna.tsinghua.edu.cn/centos/$releasever/virt/$basearch/kvm-common/
gpgcheck=0
enabled=1

安装openstack-packstack工具(每个节点都执行)

yum install openstack-packstack -y

生成openstack应答文件

packstack --gen-answer-file=openstack.txt

修改openstack应答文件

[19:57 root@localhost ~]# vim openstack.txt
41 CONFIG_SWIFT_INSTALL=n  #y-n SWIFT是OpenStack的对象存储组件,默认是Y,在生产环境中一般是不装,所以改n
50 CONFIG_AODH_INSTALL=n   #y-n 不安装该服务
97 CONFIG_COMPUTE_HOSTS=192.168.100.106 #计算节点ip地址
795 CONFIG_NEUTRON_ML2_TYPE_DRIVERS=vxlan,flat
801 CONFIG_NEUTRON_ML2_TENANT_NETWORK_TYPES=vxlan
808 CONFIG_NEUTRON_ML2_MECHANISM_DRIVERS=openvswitch
813 CONFIG_NEUTRON_ML2_FLAT_NETWORKS=physnet1      #flat网络这边要设置物理网卡名字
840 CONFIG_NEUTRON_L2_AGENT=openvswitch            #L2网络的代理模式,也可选择linuxbridge
858 CONFIG_NEUTRON_OVS_BRIDGE_MAPPINGS=physnet1:br-ex    #这边要设置物理网卡的名字
869 CONFIG_NEUTRON_OVS_BRIDGE_IFACES=br-ex:eth0          #这边br-ex:eth0是网络节点的nat网卡,到时候安装完毕之后IP地址会漂到这个上
1181 CONFIG_PROVISION_DEMO=n        #DEMO是OpenStack联网下载一个测试镜像,这边没联网。说以改成n

回退leatherman版本(每个节点都执行)

#不执行此步骤会故障报错
facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory

leatherman rpm包版本问题
[20:06 root@localhost ~/openstack]# yum list | grep leatherman
leatherman.x86_64                        1.10.0-1.el7                  @epel    
leatherman-devel.x86_64                  1.10.0-1.el7                  epel 

而facter需要1.3.0
[20:09 root@localhost ~/openstack]# facter -p
facter: error while loading shared libraries: leatherman_curl.so.1.3.0: cannot open shared object file: No such file or directory

回退leatherman版本
yum downgrade leatherman -y

执行安装

packstack --answer-file=<file>

参考资料