照著官網來安裝openstack pike之environment設定

wadeson發表於2017-10-19

安裝openstack前的準備環境:

  兩個centos7系統的環境:192.168.101.10 node1,192.168.101.11 node2

控制節點node1,計算節點node2

1、統一hosts檔案:

[root@node1 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.101.10    node1
192.168.101.11    node2

 

[root@node2 ~]# cat /etc/hosts
127.0.0.1   localhost localhost.localdomain localhost4 localhost4.localdomain4
::1         localhost localhost.localdomain localhost6 localhost6.localdomain6
192.168.101.10   node1
192.168.101.11   node2

 2、時間同步(控制節點操作)

yum install chrony

 修改vim /etc/chrony.conf

allow 192.168.101.0/16    開啟

 最後開啟服務:

systemctl enable chronyd.service
systemctl start chronyd.service

 以下是計算節點或者其他節點操作:

yum install chrony

 修改vim /etc/chrony.conf

allow 192.168.101.0/16    開啟

 註釋掉:

#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
server 192.168.101.10 iburst           (新增控制節點)

  最後開啟服務:

systemctl enable chronyd.service
systemctl start chronyd.service

 有必要的化請設定時區:timedatectl set-timezone Asia/Shanghai

官網設定:

校驗結果:

3、在所有節點(這裡只有控制節點和計算節點,如果有其他節點也需要操作)操作如下:

yum install centos-release-openstack-pike
yum upgrade

   If the upgrade process includes a new kernel, reboot your host to activate it.

由於更新了kernel,於是需要進行重啟,以新核心啟動,開啟後,繼續執行:

yum install python-openstackclient
yum install openstack-selinux
 
4、安裝資料庫(在控制節點上)
# yum install mariadb mariadb-server python2-PyMySQL
# vim /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.101.10

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
# mysql_secure_installation

 5、安裝訊息佇列服務rabbitmq(控制節點上操作)

# yum install rabbitmq-server
# systemctl enable rabbitmq-server.service
# systemctl start rabbitmq-server.service
Add the openstack user:
# rabbitmqctl add_user openstack openstack(賬號和密碼)
Permit configuration, write, and read access for the openstack user:
# rabbitmqctl set_permissions openstack ".*" ".*" ".*"

 

rabbitmq服務監聽在5672、25672埠

列出rabbitmq的外掛:
# rabbitmq-plugins list

 啟動某一個外掛:

# rabbitmq-plugins enable rabbitmq_management

 重啟rabbitmq服務:

systemctl restart rabbitmq-server.service

 上面這個開啟的外掛是一個web管理平臺,監聽在15672埠:

tcp        0      0 0.0.0.0:15672           0.0.0.0:*               LISTEN      12581/beam.smp 

 訪問這個web管理平臺:

http://192.168.101.10:15672 預設賬號密碼:guest:guest
設定使用openstack賬號登入:

設定完成,退出登入,使用openstack:openstack登入,即可成功
 
6、安裝memcached服務(控制節點):uses Memcached to cache tokens
# yum install memcached python-memcached

 修改配置檔案:/etc/sysconfig/memcached

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

 開啟memcached服務:

# systemctl enable memcached.service
# systemctl start memcached.service
tcp        0      0 192.168.101.10:11211    0.0.0.0:*               LISTEN      12982/memcached     
tcp        0      0 127.0.0.1:11211         0.0.0.0:*               LISTEN      12982/memcached

 至此openstack基本前提環境安裝完成

相關文章