本次部署的三个节点,一个控制节点,一个计算节点,一个网络节点,都是 Ubuntu 16.04 的虚拟机。
- 控制节点(controller):10.0.0.7
- 计算节点(compute):10.0.0.5
- 网络节点(network):10.0.0.25
hosts配置(所有节点)
在 /etc/hosts
文件中追加以下内容
10.0.0.7 controller
10.0.0.5 compute
10.0.0.25 network
NTP时间同步服务
安装并配置NTP服务(控制节点)
root@controller:~# apt install -y chrony
root@controller:~# vi /etc/chrony/chrony.conf
# 注释掉20行
#pool 2.debian.pool.ntp.org offline iburst
# 在67行添加以下内容
server ntp1.aliyun.com iburst
# 添加允许接受同步请求的网络范围
allow 10.0.0.0/24
# 重启服务
root@controller:~# service chrony restart
安装并配置NTP服务(其他节点)
apt install chrony -y
vi /etc/chrony/chrony.conf
# 注释掉20行
#pool 2.debian.pool.ntp.org offline iburst
# 在67行添加以下内容
server controller iburst
# 重启服务
service chrony restart
验证(控制节点)
root@controller:~# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* 120.25.115.20 2 6 37 26 +803ns[ +34us] +/- 20ms
验证(其他节点)
root@compute:~# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* controller 3 6 37 43 -48us[ -19us] +/- 21ms
root@network:~# chronyc sources
210 Number of sources = 1
MS Name/IP address Stratum Poll Reach LastRx Last sample
===============================================================================
^* controller 3 6 37 54 -3703ns[ -940us] +/- 21ms
安装OpenStack基础软件包(所有节点)
apt install software-properties-common -y
add-apt-repository cloud-archive:queens
apt update && apt dist-upgrade -y
# 安装OpenStack软件包
apt install python-openstackclient -y
安装数据库(控制节点)
root@controller:~# apt install mariadb-server python-pymysql -y
root@controller:~# vi /etc/mysql/mariadb.conf.d/99-openstack.cnf
# 这是一个新文件,写入以下内容
[mysqld]
bind-address = 10.0.0.7
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
# 重启数据库
root@controller:~# service mysql restart
# 对数据库进行初始化动作,需要输入一个密码(root)作为数据库密码,其余一路回车即可
root@controller:~# mysql_secure_installation
安装RabbitMq消息队列(控制节点)
root@controller:~# apt install rabbitmq-server -y
# 添加消息队列服务的用户
root@controller:~# rabbitmqctl add_user openstack root
Creating user "openstack"
# 为openstack用户添加权限
root@controller:~# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
Setting permissions for user "openstack" in vhost "/"
安装Memcached缓存(控制节点)
root@controller:~# apt install memcached python-memcache -y
root@controller:~# vi /etc/memcached.conf
# 修改35行为控制节点的ip
-l 10.0.0.7
# 重启服务
root@controller:~# service memcached restart