控制节点安装 chrony

yum install chrony -y
vim /etc/chrony.conf(添加)
server NTP_SERVER iburst
allow 10.0.201.0/24

systemctl enable chronyd.service
systemctl start chronyd.service

计算节点安装 chrony

yum install chrony -y
vim /etc/chrony.conf(添加)
server controller iburst
并注释(server 0.centos.pool.ntp.org iburst)这几行

systemctl enable chronyd.service
systemctl start chronyd.service

控制节点运行以下命令

[root@controller ~]# chronyc sources
210 Number of sources = 4
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^? ntp6.flashdance.cx            2   7     3    86  +4000us[+2661us] +/-  154ms
^+ ntp1.as200552.net             2   6   377    26    -11ms[  -11ms] +/-  134ms
^* ntppool2.time.nl              1   6   377    27    +13ms[  +12ms] +/-  113ms
^+ ntp1.vmar.se                  2   6   377    25  +8357us[+8357us] +/-  150ms

计算节点运行一下命令

[root@compute-1 ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^? controller                    0   7     0     -     +0ns[   +0ns] +/-    0ns

[root@compute-2 ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^? controller                    0   6     0     -     +0ns[   +0ns] +/-    0ns

安装openstack的库(三台都做)

yum install centos-release-openstack-train -y
# centos8才执行一下命令
# yum config-manager --set-enabled powertools

# 更新软件包
yum upgrade -y
# 安装openstack客户端
yum install python-openstackclient -y 
# 安装selinux
yum install openstack-selinux -y

安装sql数据库(control节点)

  • 账密为:root:xxxxxxx
yum install mariadb mariadb-server python2-PyMySQL -y

创建和编辑/etc/my.cnf.d/openstack.cnf

[mysqld]
bind-address = 10.0.19.133

default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

启动和开机自启数据库

systemctl enable mariadb.service
systemctl start mariadb.service

配置数据库

  • root的账密为:root:xxxxxxx
mysql_secure_installation
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!

In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, and
you haven't set the root password yet, the password will be blank,
so you should just press enter here.

Enter current password for root (enter for none):     #直接回车
OK, successfully used password, moving on...

Setting the root password ensures that nobody can log into the MariaDB
root user without the proper authorisation.

Set root password? [Y/n] y
New password:           #设置密码xxxxxxx
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!


By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB without having to have a user account created for
them.  This is intended only for testing, and to make the installation
go a bit smoother.  You should remove them before moving into a
production environment.

Remove anonymous users? [Y/n] y
 ... Success!

Normally, root should only be allowed to connect from 'localhost'.  This
ensures that someone cannot guess at the root password from the network.

Disallow root login remotely? [Y/n] y
 ... Success!

By default, MariaDB comes with a database named 'test' that anyone can
access.  This is also intended only for testing, and should be removed
before moving into a production environment.

Remove test database and access to it? [Y/n] y
 - Dropping test database...
 ... Success!
 - Removing privileges on test database...
 ... Success!

Reloading the privilege tables will ensure that all changes made so far
will take effect immediately.

Reload privilege tables now? [Y/n] y
 ... Success!

Cleaning up...

All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.

Thanks for using MariaDB!

安装RabbitMQ消息队列(control节点)

#安装
yum install rabbitmq-server -y

#启动和开机自启
systemctl enable rabbitmq-server.service
systemctl start rabbitmq-server.service

#添加openstack用户
rabbitmqctl add_user openstack openstack

# 配置用户读写权限
rabbitmqctl set_permissions openstack ".*" ".*" ".*"

# 设置角色
rabbitmqctl set_user_tags openstack administrator

# 启动web插件
rabbitmq-plugins enable rabbitmq_management

如果启动插件报错

Plugin configuration unchanged.

Applying plugin configuration to rabbit@controller... failed.
Error: {cannot_read_enabled_plugins_file,"/etc/rabbitmq/enabled_plugins",
           eacces}

则执行:

umask 0022; rabbitmq-plugins enable rabbitmq_management

安装memcached服务(control节点)

yum -y install memcached python-memcached

编辑/etc/sysconfig/memcached

OPTIONS="-l 127.0.0.1,::1,controller"

启动和自启

systemctl enable memcached.service
systemctl start memcached.service

安装etcd服务(control节点)

yum -y install etcd

修改etcd文件vim /etc/etcd/etcd.conf

[root@controller ~]# cat /etc/etcd/etcd.conf |grep -v '^#'
#[Member]
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://10.0.19.133:2380"
ETCD_LISTEN_CLIENT_URLS="http://10.0.19.133:2379"
ETCD_NAME="controller"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://10.0.19.133:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://10.0.19.133:2379"
ETCD_INITIAL_CLUSTER="default=http://10.0.19.133:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"

开机自启和启动etcd

systemctl start etcd
systemctl enable etcd