根据需求创建脚本,可以快速添加节点
#:初始化node节点 [root@node2 ~]# systemctl disable NetworkManager [root@node2 ~]# vim /etc/sysconfig/selinux SELINUX=disabled [root@node2 ~]# crontab -e */5 * * * * /sbin/ntpdate ntp.sjtu.edu.cn && /usr/sbin/hwclock -w [root@node2 ~]# vim /etc/hostname node2.magedu.com [root@node2 ~]# systemctl disable firewalld #:重启 [root@node2 ~]# reboot #:先配置解析 (实践中可指向dns服务器) [root@node2 ~]# vim /etc/hosts 192.168.7.101 www.magedu.net #:安装yum源,及其组件 [root@node2 ~]# yum install centos-release-openstack-stein -y [root@node2 ~]# yum install python-openstackclient openstack-selinux -y #:安装nova服务 [root@node2 ~]# yum install openstack-nova-compute -y #:在已经配置好的node节点打包文件 [root@node1 ~]# cd /etc/nova/ [root@node1 nova]# tar zcvf nova.tar.gz ./* #:将打包文件传到node2节点 [root@node1 nova]# scp nova.tar.gz 192.168.7.104:/etc/nova/ #:在node2节点解压 [root@node2 nova]# tar xf nova.tar.gz #:修改配置文件中的地址 [root@node2 nova]# sed -i "s/server_proxyclient_address = 192.168.7.103/server_proxyclient_address = 192.168.7.104/g" /etc/nova/nova.conf #:启动服务 [root@node2 nova]# systemctl enable libvirtd.service openstack-nova-compute.service [root@node2 nova]# systemctl start libvirtd.service openstack-nova-compute.service #:安装neutron服务 [root@node2 nova]# yum install openstack-neutron-linuxbridge ebtables ipset -y #:在node节点打包已经安装好的配置文件 [root@node1 nova]# cd /etc/neutron/ [root@node1 neutron]# tar zcvf neutron.tar.gz ./* #:将打包好的文件拷贝到node2节点 [root@node1 neutron]# scp neutron.tar.gz 192.168.7.104:/etc/neutron/ #:在node2节点解压 [root@node2 nova]# cd /etc/neutron/ [root@node2 neutron]# tar xf neutron.tar.gz #:修改sysctl [root@node2 neutron]# vim /etc/sysctl.conf net.bridge.bridge-nf-call-iptables = 1 net.bridge.bridge-nf-call-ip6tables = 1 #:启动服务 [root@node2 neutron]# systemctl restart openstack-nova-compute.service [root@node2 neutron]# systemctl enable neutron-linuxbridge-agent.service [root@node2 neutron]# systemctl start neutron-linuxbridge-agent.service #:生效sysctl [root@node2 neutron]# sysctl -p