Openstack Queens 环境搭建(二)环境相关服务

Controller节点:

1、安装NTP服务:

# yum install chrony

# vi /etc/chrony.conf

server 0.centos.pool.ntp.org iburst
server 1.centos.pool.ntp.org iburst
server 2.centos.pool.ntp.org iburst
server 3.centos.pool.ntp.org iburst
...
allow 192.100.10.0/24
...

# systemctl enable chronyd.service                            开机启用NTP
# systemctl start chronyd.service                             开启NTP服务

验证NTP服务:

# chronyc sources

  210 Number of sources = 2
  MS Name/IP address         Stratum Poll Reach LastRx Last sample
  ===============================================================================
  ^- 192.0.2.11                    2   7    12   137  -2814us[-3000us] +/-   43ms
  ^* 192.0.2.12                    2   6   177    46    +17us[  -23us] +/-   68ms

2、安装Openstack相关库

# yum install centos-release-openstack-queens                 安装Openstack库
# yum upgrade                                                 更新包
# yum install python-openstackclient                          安装Openstack客户端
# yum install openstack-selinux                               安装openstack-selinux用来管理Openstack服务的安全策略

3、关闭防火墙

# systemctl stop firewalld                                    关闭防火墙服务
# systemctl disable firewalld                                 永久防火墙开机自启动

4、关闭selinux服务

# setenforce 0                                               关闭selinux服务

# vi /etc/selinux/config                                     永久关闭selinux服务

    SELINUX=disabled

5、安装数据库服务

# yum install mariadb mariadb-server python2-PyMySQL

# vi /etc/my.cnf.d/openstack.cnf

[mysqld]
bind-address = 192.100.10.160
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                     开机启用Mysql服务
# systemctl start mariadb.service                      开启Mysql服务
# mysql_secure_installation                            设置Mysql密码->123456

6、安装消息队列

# yum install rabbitmq-server

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

# rabbitmqctl add_user openstack 123456
# rabbitmqctl set_permissions openstack ".*" ".*" ".*"

7、安装Memcached缓存

# yum install memcached python-memcached

# vi /etc/sysconfig/memcached
OPTIONS="-l 127.0.0.1,::1,controller"

# systemctl enable memcached.service
# systemctl start memcached.service

8、Etcd

# yum install etcd

# vi /etc/etcd/etcd.conf
#[Member]
ETCD_DATA_DIR="/var/lib/etcd/default.etcd"
ETCD_LISTEN_PEER_URLS="http://192.100.10.160:2380"
ETCD_LISTEN_CLIENT_URLS="http://192.100.10.160:2379"
ETCD_NAME="controller"
#[Clustering]
ETCD_INITIAL_ADVERTISE_PEER_URLS="http://192.100.10.160:2380"
ETCD_ADVERTISE_CLIENT_URLS="http://192.100.10.160:2379"
ETCD_INITIAL_CLUSTER="controller=http://192.100.10.160:2380"
ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01"
ETCD_INITIAL_CLUSTER_STATE="new"

# systemctl enable etcd
# systemctl start etcd

Compute节点:
1、安装NTP服务:

# yum install chrony

# vi /etc/chrony.conf

server controller iburst
...
allow 192.100.10.0/24
...

# systemctl enable chronyd.service                            开机启用NTP
# systemctl start chronyd.service                             开启NTP服务

2、安装Openstack相关库

# yum install centos-release-openstack-queens                 安装Openstack库
# yum upgrade                                                 更新包
# yum install python-openstackclient                          安装Openstack客户端
# yum install openstack-selinux                               安装openstack-selinux用来管理Openstack服务的安全策略

3、关闭防火墙

# systemctl stop firewalld                                    关闭防火墙服务
# systemctl disable firewalld                                 永久防火墙开机自启动

4、关闭selinux服务

# setenforce 0                                               关闭selinux服务

# vi /etc/selinux/config                                     永久关闭selinux服务

    SELINUX=disabled

你可能感兴趣的:(openstack)