使用脚本部署OpenStack平台

1.准备两台虚拟机

192.168.100.10 controller 控制节点

192.168.100.20 compute 计算节点

准备2台VMware虚拟机,手动最小化安装2台CentOS 7.2系统,作为OpenStack节点,第一张网卡为仅主机模式,第二张网卡为NAT模式,以及配置CPU虚拟化,计算节点至少使用4 GB内存,硬盘不小于50GB。第一张网卡网段为192.168.10.0/24,第二张网卡网段为192.168.20.0/24。并对compute节点分两个区为sda3与sda4。

2.配置yum源(两个节点都要配,可以使用ftp服务)

[root@localhost ~]# mount /dev/cdrom /opt/centos/
mount: /dev/sr0 写保护,将以只读方式挂载 [root@localhost ~]# mount /root/XianDian-IaaS-v2.2.iso /opt/iaas mount: /dev/loop0 写保护,将以只读方式挂载 [root@localhost ~]# ll 总用量 2784676 -rw-------. 1 root root 988 12月 16 09:22 anaconda-ks.cfg -rw-r--r--. 1 root root 2851502080 12月 16 09:34 XianDian-IaaS-v2.2.iso [root@localhost ~]# rm -rf /etc/yum.repos.d/CentOS-* [root@localhost ~]# vi /etc/yum.repos.d/wuhu.repo [root@localhost ~]# cat /etc/yum.repos.d/wuhu.repo [centos] name=centos baseurl=file:///opt/centos gpgcheck=0 enabled=1 [iaas] name=iaas baseurl=file:///opt/iaas/iaas-repo gpgcheck=0 enabled=1 [root@localhost ~]# yum clean all 已加载插件:fastestmirror 正在清理软件源: centos iaas Cleaning up everything [root@localhost ~]# yum repolist 已加载插件:fastestmirror centos | 3.6 kB 00:00:00 iaas | 2.9 kB 00:00:00 (1/3): centos/group_gz | 155 kB 00:00:00 (2/3): iaas/primary_db | 2.3 MB 00:00:00 (3/3): centos/primary_db | 2.8 MB 00:00:00 Determining fastest mirrors 源标识 源名称 状态 centos centos 3,723 iaas iaas 1,688 repolist: 5,411

3.安装iaas-xiandian服务

yum install iaas-xiandian -y

配置环境变量

[root@localhost ~]# cat  /etc/xiandian/openrc.sh 
##--------------------system Config--------------------##
##Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.100.10

##Controller Server hostname. example:controller
HOST_NAME=controller

##Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.100.20

##Compute Node hostname. example:compute
HOST_NAME_NODE=compute

##--------------------Rabbit Config ------------------##
##user for rabbit. example:openstack
RABBIT_USER=openstack

##Password for rabbit user .example:000000
RABBIT_PASS=000000

##--------------------MySQL Config---------------------##
##Password for MySQL root user . exmaple:000000
DB_PASS=000000

##--------------------Keystone Config------------------##
##Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=demo
ADMIN_PASS=000000
DEMO_PASS=000000

##Password for Mysql keystore user. exmaple:000000
KEYSTONE_DBPASS=000000

##--------------------Glance Config--------------------##
##Password for Mysql glance user. exmaple:000000
GLANCE_DBPASS=000000

##Password for Keystore glance user. exmaple:000000
GLANCE_PASS=000000

##--------------------Nova Config----------------------##
##Password for Mysql nova user. exmaple:000000
NOVA_DBPASS=000000

##Password for Keystore nova user. exmaple:000000
NOVA_PASS=000000

##--------------------Neturon Config-------------------##
##Password for Mysql neutron user. exmaple:000000
NEUTRON_DBPASS=000000

##Password for Keystore neutron user. exmaple:000000
NEUTRON_PASS=000000

##metadata secret for neutron. exmaple:000000
METADATA_SECRET=000000

##External Network Interface. example:eth1
INTERFACE_NAME=eno33554960

##First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
minvlan=101

##Last Vlan ID in VLAN RANGE for VLAN Network. example:200
maxvlan=200

##--------------------Cinder Config--------------------##
##Password for Mysql cinder user. exmaple:000000
CINDER_DBPASS=000000

##Password for Keystore cinder user. exmaple:000000
CINDER_PASS=000000

##Cinder Block Disk. example:md126p3
BLOCK_DISK=sdb1

##--------------------Trove Config--------------------##
##Password for Mysql Trove User. exmaple:000000
TROVE_DBPASS=000000

##Password for Keystore Trove User. exmaple:000000
TROVE_PASS=000000

##--------------------Swift Config---------------------##
##Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000

##The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sdb2

##The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.100.20

##--------------------Heat Config----------------------##
##Password for Mysql heat user. exmaple:000000
HEAT_DBPASS=

##Password for Keystore heat user. exmaple:000000
HEAT_PASS=

##--------------------Ceilometer Config----------------##
##Password for Mysql ceilometer user. exmaple:000000
CEILOMETER_DBPASS=

##Password for Keystore ceilometer user. exmaple:000000
CEILOMETER_PASS=

##--------------------AODH Config----------------##
##Password for Mysql AODH user. exmaple:000000
AODH_DBPASS=

##Password for Keystore AODH user. exmaple:000000
AODH_PASS=

4.安装基础服务

[root@localhost ~]# iaas-pre-host.sh

使用脚本部署OpenStack平台

 

 5.跑脚本

控制节点通过脚本安装MySQL数据库服务:
[root@controller~]# iaas-install-mysql.sh
安装Keystone认证服务
控制节点通过脚本安装Keystone认证服务:
[root@controller ~]# iaas-install-keystone.sh
安装Glance镜像服务
控制节点通过脚本安装Glance镜像服务:
[root@controller ~]# iaas-install-glance.sh
安装Nova计算服务
controller节点通过脚本安装计算服务:
[root@controller ~]# iaas-install-nova-controller.sh
compute节点通过脚本安装计算服务:
[root@compute~]# iaas-install-nova-compute.sh
安装Neutron网络服务
controller节点通过脚本安装网络服务:
[root@controller ~]# iaas-install-neutron-controller.sh
[root@controller ~]# iaas-install-neutron-controller-gre.sh
compute节点通过脚本安装网络服务:
[root@compute~]# iaas-install-neutron-compute.sh
[root@compute~]# iaas-install-neutron-compute-gre.sh
安装Dashboard服务
controller节点通过脚本安装Dashboard服务:
[root@controller ~]# iaas-install-dashboard.sh
安装Cinder块存储服务
controller节点通过脚本安装块存储服务:
[root@controller ~]# iaas-install-cinder-controller.sh
compute节点通过脚本安装块存储服务:
[root@compute~]# iaas-install-cinder-compute.sh
安装Swift对象存储服务
controller节点通过脚本安装对象存储服务:
[root@controller ~]# iaas-install-swift-controller.sh
compute节点通过脚本安装对象存储服务:
[root@compute ~]# iaas-install-swift-compute.sh

6.访问Dashboard服务

http://IP/dashboard
用户:admin
密码:000000

使用脚本部署OpenStack平台

 

上一篇:脚本太多不好管理?Jmeter这个组件帮你轻松搞定


下一篇:蓝牙耳机半入耳式推荐,NANK南卡和FIIL斐耳蓝牙耳机哪个更好?