OpenStack R版云平台搭建在实验环境中搭建一套通用的OpenStack云平台环境。环境基于OpenStack R版进行搭建。
要求:
OpenStack云平台环境搭建完成后,能在平台上创建云主机,并能实现云主机访问互联网。
2.1.1 实验步骤及结果
1) 安装基础环境&服务
主机配置:
安装netstat命令工具(controller and compute):
yum install net-tools
安装文件编辑自动化工具(controller and compute):
yum install -y openstack-utils
关闭防火墙(controller and compute):
systemctl stop firewalld
修改hosts解析(controller and compute):
vi /etc/hosts
10.100.30.2 controller
10.100.30.3 compute
安装NTP,配置NTP同步:
Controller:
yum install chrony -y
vi /etc/chrony.conf
allow 10.100.0.0/16 (文件修改处)
systemctl restart chronyd.service
systemctl enable chronyd.service
Compute:
yum install chrony -y
vi /etc/chrony.conf
server controller iburst (文件修改处)
systemctl restart chronyd.service
systemctl enable chronyd.service
测试时间同步:
date
chronyc sources
ping controller
ping compute
安装openstack rocky版yum源(controller and compute):
yum install centos-release-openstack-rocky
安装openstack客户端(controller and compute):
yum install python-openstackclient
安装openstack安全包(controller and compute):
yum install openstack-selinux
安装mariadb数据库(controller):
yum install mariadb mariadb-server python2-PyMySQL
新建并编辑数据库文件(controller):
vi /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 10.100.30.2
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
启动数据库,并设置数据库开机启动(controller):
systemctl enable mariadb.service
systemctl start mariadb.service
数据库安全初始化:
mysql_secure_installation
回车--->n--->一路y。
安装消息队列服务(controller):
yum install rabbitmq-server
systemctl enable rabbitmq-server.service
systemctl restart rabbitmq-server.service
创建用户(用户名:openstack 密码:RABBIT_PASS):
rabbitmqctl add_user openstack RABBIT_PASS
用户授予权限:
rabbitmqctl set_permissions openstack ".*" ".*" ".*"
netstat -lntup:查看,有25672和5672端口,表示安装成功。