一、實驗說明
按照官方文檔搭建queens版本openstack,拓撲如下圖所示:
二、實驗目的
準備好openstack元件安裝前所需要的其他軟體,如MariaDB,RabbitMQ等。
三、操作步驟
修改所有節點/etc/hosts檔案
如果hosts檔案中有将主機名解析到127.0.0.1的配置段,将其登出
所有節點關閉NetworkManager
[[email protected] ~]# systemctl stop NetworkManager.service
[[email protected] ~]# systemctl disable NetworkManager.service
所有節點添加openstack需要的yum源
[[email protected] ~]# vim /etc/yum.repo.d/OpenStack-Queens.repo
[OpenStack-Queens]
name=OpenStack-Queens
baseurl=https://mirrors.aliyun.com/centos/7/cloud/x86_64/openstack-queens/
enable=1
gpgcheck=0
安裝NTP服務
controller節點進行以下操作:
-
安裝并設定允許同步的網段
[[email protected] ~]# yum install chrony
[[email protected] ~]# vim /etc/chrony.conf
allow 172.16.80.0/24
-
啟動NTP服務并同步測試
[[email protected] ~]# systemctl enable chronyd.service
[[email protected] ~]# systemctl start chronyd.service
[[email protected] ~]# chronyc sources
其他節點進行以下操作:
-
安裝NTP并設定向controller進行時間同步
[[email protected] ~]# yum install chrony
[[email protected] ~]# vim /etc/chrony.conf
server controller iburst
-
啟動服務并驗證同步
[[email protected] ~]# systemctl enable chronyd.service
[[email protected] ~]# systemctl start chronyd.service
[[email protected] ~]# chronyc sources
安裝資料庫
-
安裝并編輯配置檔案
[[email protected] ~]# yum install mariadb mariadb-server python2-PyMySQL
[[email protected] ~]# vim /etc/my.cnf.d/openstack.cnf
[mysqld] bind-address = 172.16.80.10 default-storage-engine = innodb innodb_file_per_table = on max_connections = 4096 collation-server = utf8_general_ci character-set-server = utf8 skip_name_resolve = 1
-
啟動資料庫
[[email protected] ~]# systemctl enable mariadb.service
[[email protected] ~]# systemctl start mariadb.service
安裝消息中間件
-
安裝rabbitmq中間件
[[email protected] ~]# yum install rabbitmq-server
-
加載rabbitmq_management插件啟用圖形界面
[[email protected] ~]# rabbitmq-plugins enable rabbitmq_management
[[email protected] ~]# systemctl start rabbitmq-server.service
-
為openstack建立使用者并授權
[[email protected] ~]# rabbitmqctl add_user openstack password1!
[[email protected] ~]# rabbitmqctl set_permissions openstack "." "." ".*"
安裝認證緩存
-
安裝程式包
[[email protected] ~]# yum install memcached python-memcached
-
配置并啟用程式
[[email protected] ~]# vim /etc/sysconfig/memcached
[[email protected] ~]# systemctl enable memcached.service
[[email protected] ~]# systemctl start memcached.service
安裝分布式密鑰存儲
-
下載下傳安裝包
[[email protected] ~]# yum install etcd
-
編輯配置檔案并啟動
[[email protected] ~]# vim /etc/etcd/etcd.conf
#[Member] ETCD_DATA_DIR="/var/lib/etcd/default.etcd" ETCD_LISTEN_PEER_URLS="http://172.16.80.10:2380" ETCD_LISTEN_CLIENT_URLS="http://172.16.80.10:2379" ETCD_NAME="controller" #[Clustering] ETCD_INITIAL_ADVERTISE_PEER_URLS="http://172.16.80.10:2380" ETCD_ADVERTISE_CLIENT_URLS="http://172.16.80.10:2379" ETCD_INITIAL_CLUSTER="controller=http://172.16.80.10:2380" ETCD_INITIAL_CLUSTER_TOKEN="etcd-cluster-01" ETCD_INITIAL_CLUSTER_STATE="new"
[[email protected] ~]# systemctl enable etcd
[[email protected] ~]# systemctl start etcd
至此,openstack安裝前準備工作全部完成。
轉載于:https://blog.51cto.com/arkling/2133898