电竞比分网-中国电竞赛事及体育赛事平台

分享

OpenStack云平臺搭建

 netouch 2025-07-22 發(fā)布于北京

參考:

https://blog.csdn.net/m0_45692110/article/details/122628664

https://huaweicloud.csdn.net/635607c3d3efff3090b58eb4.html

一、虛擬機準備

controller和compute虛擬機,使用centos7操作系統(tǒng),下面給出一些需要修改的地方,其他都可以使用默認,點擊下一步即可

controller:

一塊磁盤200G

兩塊網卡:

192.168.100.10

192.168.200.10

compute:

兩塊磁盤:200G+100G

兩塊網卡:

192.168.100.20

192.168.200.20

1.controller

(1)創(chuàng)建虛擬機

全名:登錄時看到的名字

用戶名:虛擬機終端中顯示的名字

密碼:123456

image

設置處理器內核

image

設置內存2G

image

設置磁盤200G

image

添加兩塊網卡

image

(2)虛擬機配置

修改主機名

hostnamectl set-hostname controller

②查看網卡

cd /etc/sysconfig/network-scripts

image

③編輯網卡配置文件,設置網卡ip地址

詳情見https://www.cnblogs.com/Studywith/p/16946297.html,其中對網絡的配置有較詳細解釋

網卡1:

192.168.100.10

image

網卡2:

192.168.200.10

image

④重啟網卡

  1. service network restart #重啟虛擬機網卡
  2. reboot #重啟虛擬機
  3. ip addr #查看網絡信息
image

2.compute

(1)創(chuàng)建虛擬機

基本一致,完成創(chuàng)建后額外添加一塊100GB硬盤和一塊網卡

image
image

這里使用稍后安裝操作系統(tǒng)的方式(controller使用的是簡易安裝),學習一下這種方式

①磁盤分區(qū)

image
image
image

②設置主機名

image

③等待安裝

這里沒有創(chuàng)建初始用戶,直接使用root(密碼:123456)賬號(不像簡易安裝會創(chuàng)建一個初始用戶)

image
image

(2)虛擬機配置

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

網卡1:

192.168.100.20

image

網卡2:

192.168.200.20

image
image

二、云平臺搭建

1.準備

(1)MobaXterm連接虛擬機

image

(2)配置host地址映射

直接使用域名(controller,compute)來代替IP地址

image
image

使用scp命令將文件傳輸?shù)絚ompute

scp /etc/hosts 192.168.100.20:/etc/hosts

image

(3)關閉防火墻和selinux

  1. [root@controller ~]# systemctl stop firewalld #關閉防火墻
  2. [root@controller ~]# systemctl disable firewalld #設置防火墻開機不自啟
  3. Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
  4. Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.
  5. [root@controller ~]# setenforce 0 #臨時關閉selinux防火墻,0表示關閉,1表示開啟
  6. [root@controller ~]# getenforce #查看selinux防火墻的狀態(tài)
  7. Permissive
  8. [root@controller ~]# vi /etc/selinux/config #非臨時性
  9. [root@controller ~]#
image

(4)上傳鏡像文件

創(chuàng)建文件夾,將鏡像上傳

云鏡像:

鏈接:https://pan.baidu.com/s/1HdlmcOqVhNPuT0OFf_wBCA
--來自百度網盤超級會員V2的分享

centos7:

鏈接:https://pan.baidu.com/s/1rMX23XtNwmoASi3KLXFbRg
--來自百度網盤超級會員V2的分享

chinaskills_cloud_iaas.iso鏡像包含OpenStack Q版本私有云平臺搭建的各項軟件包、依賴包、安裝腳本等,同時還提供了CentOS7.2、CentOS7.5等云主機qcow2鏡像

image

2.搭建

(1)掛載鏡像

  1. mount -o loop '/export/software/CentOS-7-x86_64-DVD-2009.iso' /mnt/
  2. mkdir /opt/centos #該文件夾存儲centos系統(tǒng)
  3. mkdir /opt/cloud #該文件夾存儲OpenStack鏡像
  4. cp -rf /mnt/* /opt/centos/ #轉移
  5. umount /mnt/ #解除寫保護
  6. mount -o loop '/export/software/chinaskills_cloud_iaas.iso' /mnt/
  7. cp -rf /mnt/* /opt/cloud/ #轉移
  8. umount /mnt/

剩下的命令基本不用修改,也不會出錯,就直接對著原博客抄命令了,編輯鏡像源配置文件時注意不要出錯,對應自己的鏡像存儲位置:https://blog.csdn.net/m0_45692110/article/details/122628664

修改鏡像源

image

完成配置

image

(2)compute配置

查看磁盤分區(qū)情況

image

分區(qū)sdb命令后

image

鏡像源使用controller中配置好的

image

完成配置

image

(3)OpenStack腳本執(zhí)行

這里執(zhí)行iaas-install-neutron-controller.sh時報錯file not found,這個是因為版本沖突的問題,解決方法如下:https://ask.csdn.net/questions/7746766

image

(4)完成

登錄http://192.168.100.10/dashboard

image
image

    本站是提供個人知識管理的網絡存儲空間,所有內容均由用戶發(fā)布,不代表本站觀點。請注意甄別內容中的聯(lián)系方式、誘導購買等信息,謹防詐騙。如發(fā)現(xiàn)有害或侵權內容,請點擊一鍵舉報。
    轉藏 分享 獻花(0

    0條評論

    發(fā)表

    請遵守用戶 評論公約

    類似文章 更多