搭建openstack平台(centos7+iaas)

centos7搭建openstack(iaas)

环境准备:

controller节点

1.2cpu,2g内存
2.双网卡,两块100g磁盘
3.opt目录下存有iaas源iso镜像

compute节点

1.2cpu,2g内存
2.双网卡,两块100g磁盘
3.opt目录下存有iaas源iso镜像

网卡 网段
eth0 192.168.10.0/24
eth1 192.168.20.0/24

配置:

第一步:配置IP

controller

hostnamectl set-hostname controller
vi /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth1
vi /etc/hosts
setenforce 0
vi /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
systemctl restart network

搭建openstack平台(centos7+iaas)_第1张图片
搭建openstack平台(centos7+iaas)_第2张图片
搭建openstack平台(centos7+iaas)_第3张图片
在这里插入图片描述
搭建openstack平台(centos7+iaas)_第4张图片在这里插入图片描述

compute

hostnamectl set-hostname controller
vi /etc/sysconfig/network-scripts/ifcfg-eth0
vi /etc/sysconfig/network-scripts/ifcfg-eth1
vi /etc/hosts
setenforce 0
vi /etc/selinux/config
systemctl stop firewalld
systemctl disable firewalld
systemctl restart network

在这里插入图片描述
搭建openstack平台(centos7+iaas)_第5张图片
搭建openstack平台(centos7+iaas)_第6张图片
在这里插入图片描述

第二步:配置yum源

两台主机配置相同

mkdir -p /mnt/cdrom
mkdir -p /mnt/iaas
echo "/dev/cdrom /mnt/cdrom iso9660 defaults 0 0" >> /etc/fstab
echo "/opt/chinaskills_cloud_iaas.iso /mnt/iaas iso9660 defaults,loop 0 0" >> /etc/fstab
mount -a

搭建openstack平台(centos7+iaas)_第7张图片

cd /etc/yum.repos.d/
mkdir 1
mv * ./1
vi local.repo
	.......
yum clean all
yum makecache

搭建openstack平台(centos7+iaas)_第8张图片
搭建openstack平台(centos7+iaas)_第9张图片

第三步:安装xiandian并编辑配置文件

controller

yum -y install vim iaas-xiandian
vim /etc/xiandian/openrc.sh
	*/ctrl+v然后shift+g然后d,即可删除注释,然后i建编辑
-----------------------------------------------------------------------------------
#--------------------system Config--------------------##
#Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.10.10	*/control节点IP

#Controller HOST Password. example:000000 
HOST_PASS=123456			*/密码

#Controller Server hostname. example:controller
HOST_NAME=controller			*/主机名

#Compute Node Manager IP. example:x.x.x.x
HOST_IP_NODE=192.168.10.20		*/compute节点IP

#Compute HOST Password. example:000000 
HOST_PASS_NODE=123456

#Compute Node hostname. example:compute
HOST_NAME_NODE=compute

#--------------------Chrony Config-------------------##
#Controller network segment IP.  example:x.x.0.0/16(x.x.x.0/24)
network_segment_IP=192.168.10.0/24		*/control节点网段

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

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

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

#--------------------Keystone Config------------------##
#Password for Keystore admin user. exmaple:000000
DOMAIN_NAME=demo			*/域名项目
ADMIN_PASS=123456
DEMO_PASS=123456

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

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

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

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

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

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

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

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

#Tunnel Network Interface. example:x.x.x.x
INTERFACE_IP=192.168.10.10		*/本机IP

#External Network Interface. example:eth1
INTERFACE_NAME=eth0			*/外网卡

#External Network The Physical Adapter. example:provider
Physical_NAME=provider

#First Vlan ID in VLAN RANGE for VLAN Network. exmaple:101
minvlan=101		*/允许创建vlan的初始位

#Last Vlan ID in VLAN RANGE for VLAN Network. example:200
maxvlan=200			*/允许创建的最后一个vlan

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

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

#Cinder Block Disk. example:md126p3
BLOCK_DISK=sda			*/control节点的第一块磁盘

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

#The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sdb		*/control节点第二块磁盘

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

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

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

#--------------------Zun Config-----------------------##
#Password for Mysql Zun user. exmaple:000000
ZUN_DBPASS=123456

#Password for Keystore Zun user. exmaple:000000
ZUN_PASS=123456

#Password for Mysql Kuryr user. exmaple:000000
KURYR_DBPASS=123456

#Password for Keystore Kuryr user. exmaple:000000
KURYR_PASS=123456

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

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

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

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

#--------------------Barbican Config----------------##
#Password for Mysql Barbican user. exmaple:000000
BARBICAN_DBPASS=123456

#Password for Keystore Barbican user. exmaple:000000
BARBICAN_PASS=123456

搭建openstack平台(centos7+iaas)_第10张图片
搭建openstack平台(centos7+iaas)_第11张图片搭建openstack平台(centos7+iaas)_第12张图片
搭建openstack平台(centos7+iaas)_第13张图片

compute

yum -y insall vim iaas-xiandian
scp controller:/etc/xiandian/openrc.sh /etc/xiandian/openrc.sh
vim /etc/xiandian/openrc.sh
	修改interface隧道接口IP为本机IP192.168.10.20

搭建openstack平台(centos7+iaas)_第14张图片
搭建openstack平台(centos7+iaas)_第15张图片

第四步:刷脚本配置

controller

iaas-pre-host.sh
然后重启
iaas-install-mysql.sh
iaas-install-keystone.sh
iaas-install-glance.sh
iaas-install-nova-controller.sh
iaas-install-neutron-controller.sh
iaas-install-dashboard.sh
iaas-install-cinder-controller.sh
iaas-insatll-swift-controller.sh

搭建openstack平台(centos7+iaas)_第16张图片
先刷完control节点再刷compute

compute

iaas-pre-host.sh
iaas-install-nova-compute.sh
iaas-install-neutron-compute.sh
iaas-install-cinder-compute.sh
iaas-insatll-swift-compute.sh
第五步:登录open stack

http://192.168.10.10/dashboard
搭建openstack平台(centos7+iaas)_第17张图片搭建openstack平台(centos7+iaas)_第18张图片

你可能感兴趣的:(centos,Linux系统,openstack,运维,服务器,云计算,阿里云)