共計 2760 個字符,預計需要花費 7 分鐘才能閱讀完成。
自動寫代碼機器人,免費開通
針對 openstack 環境的搭建,大致涉及如下內容
安全
主要包括各項服務使用的密碼,這里為了防止密碼混亂,我建議使用同一個密碼(生產環境中,不建議這么操作)
主機網絡配置如下圖,僅供參考學習
時間同步設置
針對 controller 控制器,時間同步默認使用外網的時間同步器
1)安裝時間同步軟件包,執行命令如下:
2) 編輯 /etc/chrony.conf, 修改如下:
3) 在 /etc/chrony.conf 文件添加如下字段,允許 10.0.00/24 網段主機與 controller 進行時間同步
4)設置時間同步開機自啟動
針對其他所有節點
1)安裝時間同步軟件包
2)編輯 /etc/chrony.conf, 時間同步需要使用 controller 節點時間同步器
3)設置時間同步開機自啟動
openstack 軟件包(安裝在所有節點)
環境中使用 centos7.2 最小安裝,系統默認使用 LVM,同時禁用 SELINUX、禁用 firewalld 以及 iptables、在 centos 系統的各個節點,均執行如下操作:
安裝升級包,建議完成安裝后,重啟系統
安裝 openstack client 軟件包
安裝 openstack SELINUX,該軟件包將會接替系統自身的 SELINUX,當然我為了安全起見,我是默認禁用了所有主機的 SELINUX
在 controller 節點主機上面安裝 SQL 數據庫,并進行配置
1)安裝相關軟件包,執行命令如下:
2)在 /etc/my.cnf.d/ 下創建 openstack.cnf, 具體內容如下:
3)設置開機自啟動,并啟動數據庫服務
4)數據庫初始化,在命令行輸入如下
初始化過程命令輸出如下:
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MySQL
SERVERS IN PRODUCTION USE! PLEASE READ EACH STEP CAREFULLY!
In order to log into MySQL to secure it, we’ll need the current
password for the root user. If you’ve just installed MySQL, 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 MySQL
root user without the proper authorisation.
Set root password? [Y/n] y(第二次輸入為 y,然后設置數據庫密碼)
New password:
Re-enter new password:
Password updated successfully!
Reloading privilege tables..
… Success!
By default, a MySQL installation has an anonymous user, allowing anyone
to log into MySQL 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(第三次輸入為 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] n(第四次輸入為 n)
… skipping.
By default, MySQL 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(第五次輸入為 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(第六次輸入為 y)
… Success!
Cleaning up…
安裝 NoSQL 數據庫(僅在 controller 節點操作)
1)安裝軟件包,執行命令如下:
2)編輯 /etc/mongod.conf, 修改 bind_ip 為控制器的管理 IP,即 10.0.0.11,并去掉 smallfiles=true 的前面的注釋符號
官方說法如下
在目錄 /var/lib/mongodb/ 下默認是不存在 journal 目錄的,當我們修改載 /etc/mongod.conf 目錄去掉 smallfiles=true 的前面的注釋符號后,并啟動 mongod 服務
就會在 /var/lib/mongodb/ 下自動生成 journal 目錄
消息隊列服務(僅在 controller 節點操作)
1)安裝軟件包
2)將消息隊列服務啟動并設置為開機自啟動
3)添加 openstack 用戶
4)為 openstack 用戶授予讀寫權限;
緩存服務(僅在 controller 節點操作)
1)安裝軟件包
2)啟動緩存服務并設置為開機自啟動
后面將對各個組件安裝配置進行講述,更多精彩,敬請期待。
參考 http://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/environment.html
向 AI 問一下細節丸趣 TV 網 – 提供最優質的資源集合!