基础配置介绍

基础镜像包

  • CentOS-7-x86_64-DVD-1804.iso
  • chinaskills_cloud_iaas.iso

基础主机环境

主机名配置网卡一IP网卡二IP
controller4核8g100g192.168.100.10192.168.200.10
compute2核8g100g192.168.100.20192.168.200.20

注:compute节点需要两块硬盘,第二块给100g
注:如果配置不够可以适度缩减compute节点的配置

实验环境配置

注:没有特殊说明的话就是两个节点都要进行

修改主机名并映射IP

controller:

# hostnamectl set-hostname controller
# vi /etc/hosts
192.168.100.10 controller
192.168.200.10 compute 

compute:

# hostnamectl set-hostname compute
# vi /etc/hosts
192.168.100.10 controller
192.168.200.10 compute 

关闭防火墙

# systemctl stop firewalld
# systemctl disable frewalld
//清除防火墙规则
# iptables -F
# iptables -X
# iptables -Z

关闭NetworkManager

# systemctl stop NetworkManager
# systemctl disable NetworkManager

关闭selinux

# setenforce 0
# vi /etc/selinux/config
SELINUX=permissive

配置网络

controller:

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR="192.168.100.10"
GATEWAY="192.168.100.1"
IPV6_AUTOCONF="yes"
NETMASK="255.255.255.0"
BOOTPROTO="static"
DEVICE="eth0"
ONBOOT="yes"
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
IPADDR="192.168.200.10"
IPV6_AUTOCONF="yes"
NETMASK="255.255.255.0"
BOOTPROTO="static"
DEVICE="eth1"
ONBOOT="yes"

compute:

# cat /etc/sysconfig/network-scripts/ifcfg-eth0
IPADDR="192.168.100.20"
GATEWAY="192.168.100.1"
IPV6_AUTOCONF="yes"
NETMASK="255.255.255.0"
BOOTPROTO="static"
DEVICE="eth0"
ONBOOT="yes"
# cat /etc/sysconfig/network-scripts/ifcfg-eth1
IPADDR="192.168.200.20"
IPV6_AUTOCONF="yes"
NETMASK="255.255.255.0"
BOOTPROTO="static"
DEVICE="eth1"
ONBOOT="yes"

注:内网卡不能配网关,否则你会发现神奇的东西

挂载镜像包

上传镜像包到controller的/opt中

# mkdir /opt/{iaas,centos}
# mount -o loop CentOS-7-x86_64-DVD-1804.iso /opt/centos
# mount -o loop chinaskills_cloud_iaas.iso /opt/iaas

为compute安装ftp服务

# yum install -y vsftpd
# vi /etc/vsftpd/vsftpd.conf
anon_root=/opt  //添加
# systemctl restart vsftpd
# systemctl enable vsftpd

配置yum源

controller:

# rm -rf /etc/yum.repos.d/*
# vi /etc/yum.repos.d/local.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
# yum clean all
# yum repolist

compute:

# rm -rf /etc/yum.repos.d/*
# vi /etc/yum.repos.d/local.repo
[centos]
name=centos
baseurl=ftp://controller/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=ftp://controller/iaas/iaas-repo
gpgcheck=0
enabled=1
# yum clean all
# yum repolist

使用chrony进行时间同步

# yum install -y chrony //双节点
# vim /etc/chrony.conf  //controller更改配置文件
server controller iburst
allow 192.168.100.0/24 
local stratum 10
# systemctl restart chronyd //启动服务
# systemctl enable chronyd

# vim /etc/chrony.conf  //添加一条按ip自动同步
server controller iburst
# systemctl restart chronyd //启动服务
# systemctl enable chronyd

将第二块硬盘分成两个50g(compute)

fdisk /dev/sdb
n
p
+50G
//重复上面操作一次
w
//重读分区表
partprobe
//查看分区状态
lsblk

开始进行安装步骤

双节点安装iaas-xiandian

# yum install -y iaas-xiandian

配置/etc/xiandian/openrc.sh(双平台)

controller:

#Controller Server Manager IP. example:x.x.x.x
HOST_IP=192.168.100.10

#Controller HOST Password. example:000000 
HOST_PASS=000000

#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 HOST Password. example:000000 
HOST_PASS_NODE=000000

#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.100.1/24

#--------------------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

#Tunnel Network Interface. example:x.x.x.x
INTERFACE_IP=192.168.100.10

#External Network Interface. example:eth1
INTERFACE_NAME=eth1 //第二张网卡名

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

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

#Last Vlan ID in VLAN RANGE for VLAN Network. example:200
maxvlan=1000
#--------------------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(空白分区1)

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

#The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sdb2(空白分区2)

#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=000000

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

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

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

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

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

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

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

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

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

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

compute:

将controller配置文件中的INTERFACE_IP改为192.168.100.20

注:检查配置文件不能出错

运行脚本进行部署

运行初始化脚本 iaas-pre-host.sh(双节点)
运行完初始化脚本重启
重启完成后重新挂载镜像或在/etc/fstab中挂载镜像

控制节点运行脚本(按步骤进行,不可跳步)
iaas-install-mysql.sh
iaas-install-keystone.sh    
// keystone admin 环境变量:/etc/keystone/admin-openrc.sh
iaas-install-glance.sh   
iaas-install-nova-controller.sh  // 安装完可安装 compute 节点的 nova
iaas-install-neutron-controller.sh   
iaas-install-dashboard.sh

 
// 块存储
iaas-install-cinder-controller.sh  
// 对象存储
iaas-install-swift-controller.sh  
// Trove 服务:需要配置好网络( flat 或 gre), 创建子网, 已安装 cinder 和 swift
iaas-install-trove.sh  
// heat 编配服务
iaas-install-heat.sh  
// Ceilometer 监控服务
iaas-install-ceilometer-controller.sh
// Alarm 服务
iaas-install-alarm.sh
计算节点运行脚本(按步骤进行,不可跳步)
iaas-install-nova-compute.sh    // controller 安装完 keystone 时可安装
iaas-install-neutron-compute.sh  


// 块存储
iaas-install-cinder-compute.sh  
// 对象存储
iaas-install-swift-compute.sh  
// Ceilometer 监控服务
iaas-install-ceilometer-compute.sh  

打开浏览器,访问192.168.100.10/dashboard

Q.E.D.


你笑的时候一晃便是经年