Q版搭建控制节点上环境准备(step2)

接下来是只需要在控制节点上准备的环境配置。其中虽然NTP服务需要在所有节点上都安装,但NTP服务在控制节点和其他的节点上的配置是不同的,所以不把它放在step1的公共配置中进行准备。如下:

1.配置NTP服务:

yum install chrony -y

vim /etc/chrony.conf

添加:

allow 192.168.0.0/24

保存退出。

systemctl enable chronyd.service && systemctl start chronyd.service

chronyc sources

返回结果中,MS列中包含^*的行,指明NTP服务当前同步的服务器。

timedatectl

返回结果中,NTP synchronized: yes说明同步成功

2.安装mariadb数据库

数据库通常在控制器节点上运行。

查看当前python版本。

[root@controller1 ~]# python --version
Python 2.7.5

安装软件:

yum install mariadb mariadb-server python2-PyMySQL -y

因为/etc/my.cnf中包含!includedir /etc/my.cnf.d配置,所以mysql在启动时,会将/etc/my.cnf.d/目录下的配置文件中的内容一起加载进去。

所以,我们可以在/etc/my.cnf.d/目录下定义自己的配置文件。

vim /etc/my.cnf.d/openstack.cnf

添加:

[mysqld]
bind-address = 192.168.0.10
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8

保存退出。

systemctl start mariadb.service && systemctl enable mariadb.service

mysql_secure_installation

将密码设置为123456                    #客官可以自己任意设置。

3.安装RabbitMQ消息队列

消息队列服务通常在控制节点上运行。

安装软件:
yum install rabbitmq-server -y

systemctl enable rabbitmq-server.service && systemctl start rabbitmq-server.service

添加用户、密码,并设置“配置、读取、写入”权限。

rabbitmqctl add_user openstack 123456

rabbitmqctl set_permissions openstack ".*" ".*" ".*"

4.安装Memcached缓存数据库

yum install memcached python-memcached -y

vim  /etc/sysconfig/memcached

将OPTIONS中的127.0.0.1修改成192.168.0.10,目的是设置memcached服务运行时的监听IP,以便其它节点也可以访问它,如下所示:

OPTIONS="-l 192.168.0.10,::1"

保存退出。

systemctl enable memcached.service && systemctl start memcached.service

5.安装etcd服务

yum install etcd -y

vim /etc/etcd/etcd.conf

按如下配置修改配置文件:  

ETCD_DATA_DIR="/var/lib/etcd/default.etcd"

ETCD_LISTEN_PEER_URLS="http://192.168.0.10:2380"

ETCD_LISTEN_CLIENT_URLS="http://192.168.0.10:2379"

ETCD_NAME="controller"
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.168.0.10:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.168.0.10:2379"

ETCD_INITIAL_CLUSTER="default=http://192.168.0.10:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster"
ETCD_INITIAL_CLUSTER_STATE="new"

保存退出。

systemctl enable etcd && systemctl start etcd

猜你喜欢

转载自www.cnblogs.com/jipinglong/p/10153956.html