openstack部署
openstack kvm宿主机的管理平台
创建的虚拟机都是链接克隆
支持多用户,自定义网络 vpc
1. 服务介绍
nova:提供计算资源
glance:镜像服务(已经安装好操作系统的磁盘文件)
neutron:网络服务(提供网络连接)
cinder:块存储服务(云硬盘)
cellometer:监控计费
keystone:认证服务,openstack账号密码
horizon:dashboard服务,web管理界面
swift:对象存储
heat:编排服务,定义yaml文件,批量启动vm
2. openstack部署
(1)环境准备
ip | name |
10.0.0.11 | controller |
10.0.0.21 | compute1 |
部署好两台机器,将名称和ip配置好
然后各自hosts添加解析
(2)准备包
chinaskills_cloud_iaas
CentOS-7-x86_64-DVD-2003
(3)安装前准备
systemctl stop firewalld
systemctl disable firewalld
setenforce 0
vim /etc/selinux/config
SELINUX=permissive # 修改该行
将上述包上传到controller和compute上,并执行以下命令挂载
mount -o loop CentOS-7-x86_64-DVD-2003.iso Centos7
mkdir /opt/openstack
cp -rf /mnt/* /opt/openstack/
umount /mnt/
mount -o loop CentOS-7-x86_64-DVD-2003.iso /mnt/
mkdir /opt/centos
cp -rp /mnt/* /opt/centos/
vim /etc/yum.repos.d/local.repo # 配置本地源
[centos]
name=centos
baseurl=file:///opt/centos
gpgcheck=0
enabled=1
[iaas]
name=iaas
baseurl=file:///opt/openstack/iaas-repo
gpgcheck=0
yum install -y vim vsftpd iaas-xiandian
# 修改vsftpd匿名访问
anonymous_enable=YES
anon_root=/opt/
###修改配置文件
vim /etc/xiandian/openrc.sh
#--------------------system Config--------------------##
#Controller Server Manager IP. example:x.x.x.x
HOST_IP=10.0.0.11 #controller节点的IP地址
#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=10.0.0.21 #compute节点的IP地址
#Compute HOST Password. example:000000
HOST_PASS_NODE=000000
#Compute Node hostname. example:compute
HOST_NAME_NODE=compute1
#--------------------Chrony Config-------------------##
#Controller network segment IP. example:x.x.0.0/16(x.x.x.0/24)
network_segment_IP=10.0.0.0/24 #controller节点所在的网段
#--------------------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=10.0.0.11 #本机IP地址
#External Network Interface. example:eth1
INTERFACE_NAME=ens33
#External Network The Physical Adapter. example:provider
Physical_NAME=provider
#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 #compute节点的存储块
#--------------------Swift Config---------------------##
#Password for Keystore swift user. exmaple:000000
SWIFT_PASS=000000
#The NODE Object Disk for Swift. example:md126p4.
OBJECT_DISK=sdb2 #compute节点的存储块
#The NODE IP for Swift Storage Network. example:x.x.x.x.
STORAGE_LOCAL_NET_IP=192.168.100.20 #compute节点的IP地址
#--------------------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节点需添加sdb盘,并划分sdb1,sdb2
(4)安装
controller节点
iaas-pre-host.sh
iaas-install-mysql.sh
iaas-install-keystone.sh
iaas-install-glance.s
iaas-install-nova-controller.sh
iaas-install-neutron-controller.sh
iaas-install-dashboard.sh
compute节点
iaas-pre-host.sh
iaas-install-nova-compute.sh
iaas-install-neutron-compute.sh
(5)登录
浏览器输入http://10.0.0.11/dashboard 用户名和密码见配置文件admin,000000