參考:
https://blog.csdn.net/m0_45692110/article/details/122628664
https://huaweicloud.csdn.net/635607c3d3efff3090b58eb4.html
一、虛擬機(jī)準(zhǔn)備
controller和compute虛擬機(jī),使用centos7操作系統(tǒng),下面給出一些需要修改的地方,其他都可以使用默認(rèn),點(diǎn)擊下一步即可
controller:
一塊磁盤200G
兩塊網(wǎng)卡:
192.168.100.10
192.168.200.10
compute:
兩塊磁盤:200G+100G
兩塊網(wǎng)卡:
192.168.100.20
192.168.200.20
1.controller
(1)創(chuàng)建虛擬機(jī)
全名:登錄時(shí)看到的名字
用戶名:虛擬機(jī)終端中顯示的名字
密碼:123456

設(shè)置處理器內(nèi)核

設(shè)置內(nèi)存2G

設(shè)置磁盤200G

添加兩塊網(wǎng)卡

(2)虛擬機(jī)配置
①修改主機(jī)名
hostnamectl set-hostname controller
②查看網(wǎng)卡
cd /etc/sysconfig/network-scripts

③編輯網(wǎng)卡配置文件,設(shè)置網(wǎng)卡ip地址
詳情見https://www.cnblogs.com/Studywith/p/16946297.html,其中對(duì)網(wǎng)絡(luò)的配置有較詳細(xì)解釋
網(wǎng)卡1:
192.168.100.10

網(wǎng)卡2:
192.168.200.10

④重啟網(wǎng)卡
service network restart #重啟虛擬機(jī)網(wǎng)卡
reboot #重啟虛擬機(jī)
ip addr #查看網(wǎng)絡(luò)信息

2.compute
(1)創(chuàng)建虛擬機(jī)
基本一致,完成創(chuàng)建后額外添加一塊100GB硬盤和一塊網(wǎng)卡


這里使用稍后安裝操作系統(tǒng)的方式(controller使用的是簡(jiǎn)易安裝),學(xué)習(xí)一下這種方式
①磁盤分區(qū)



②設(shè)置主機(jī)名

③等待安裝
這里沒有創(chuàng)建初始用戶,直接使用root(密碼:123456)賬號(hào)(不像簡(jiǎn)易安裝會(huì)創(chuàng)建一個(gè)初始用戶)


(2)虛擬機(jī)配置
發(fā)現(xiàn)這樣安裝沒有圖形界面,雖然用不到圖形界面,直接命令行就可以完成配置,但可以參考安裝一下:https://blog.csdn.net/m0_55336071/article/details/124680623
網(wǎng)卡1:
192.168.100.20

網(wǎng)卡2:
192.168.200.20


二、云平臺(tái)搭建
1.準(zhǔn)備
(1)MobaXterm連接虛擬機(jī)

(2)配置host地址映射
直接使用域名(controller,compute)來代替IP地址


使用scp命令將文件傳輸?shù)絚ompute
scp /etc/hosts 192.168.100.20:/etc/hosts

(3)關(guān)閉防火墻和selinux
[root@controller ~]# systemctl stop firewalld #關(guān)閉防火墻
[root@controller ~]# systemctl disable firewalld #設(shè)置防火墻開機(jī)不自啟
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
[root@controller ~]# setenforce 0 #臨時(shí)關(guān)閉selinux防火墻,0表示關(guān)閉,1表示開啟
[root@controller ~]# getenforce #查看selinux防火墻的狀態(tài)
Permissive
[root@controller ~]# vi /etc/selinux/config #非臨時(shí)性
[root@controller ~]#

(4)上傳鏡像文件
創(chuàng)建文件夾,將鏡像上傳
云鏡像:
鏈接:https://pan.baidu.com/s/1HdlmcOqVhNPuT0OFf_wBCA
提取碼:6h2o
--來自百度網(wǎng)盤超級(jí)會(huì)員V2的分享centos7:
鏈接:https://pan.baidu.com/s/1rMX23XtNwmoASi3KLXFbRg
提取碼:7mnf
--來自百度網(wǎng)盤超級(jí)會(huì)員V2的分享
chinaskills_cloud_iaas.iso鏡像包含OpenStack Q版本私有云平臺(tái)搭建的各項(xiàng)軟件包、依賴包、安裝腳本等,同時(shí)還提供了CentOS7.2、CentOS7.5等云主機(jī)qcow2鏡像
(1)掛載鏡像
mount -o loop "/export/software/CentOS-7-x86_64-DVD-2009.iso" /mnt/
mkdir /opt/centos #該文件夾存儲(chǔ)centos系統(tǒng)
mkdir /opt/cloud #該文件夾存儲(chǔ)OpenStack鏡像
cp -rf /mnt/* /opt/centos/ #轉(zhuǎn)移
umount /mnt/ #解除寫保護(hù)
mount -o loop "/export/software/chinaskills_cloud_iaas.iso" /mnt/
cp -rf /mnt/* /opt/cloud/ #轉(zhuǎn)移
umount /mnt/
剩下的命令基本不用修改,也不會(huì)出錯(cuò),就直接對(duì)著原博客抄命令了,編輯鏡像源配置文件時(shí)注意不要出錯(cuò),對(duì)應(yīng)自己的鏡像存儲(chǔ)位置:https://blog.csdn.net/m0_45692110/article/details/122628664
修改鏡像源

完成配置

(2)compute配置
查看磁盤分區(qū)情況

分區(qū)sdb命令后

鏡像源使用controller中配置好的

完成配置

(3)OpenStack腳本執(zhí)行
這里執(zhí)行iaas-install-neutron-controller.sh時(shí)報(bào)錯(cuò)file not found,這個(gè)是因?yàn)榘姹緵_突的問題,解決方法如下:https://ask.csdn.net/questions/7746766

(4)完成文章來源:http://www.zghlxwxcb.cn/news/detail-540509.html
登錄http://192.168.100.10/dashboard文章來源地址http://www.zghlxwxcb.cn/news/detail-540509.html


到了這里,關(guān)于OpenStack云平臺(tái)搭建的文章就介紹完了。如果您還想了解更多內(nèi)容,請(qǐng)?jiān)谟疑辖撬阉鱐OY模板網(wǎng)以前的文章或繼續(xù)瀏覽下面的相關(guān)文章,希望大家以后多多支持TOY模板網(wǎng)!