溫馨提示×

溫馨提示×

您好,登錄后才能下訂單哦!

密碼登錄×
登錄注冊×
其他方式登錄
點(diǎn)擊 登錄注冊 即表示同意《億速云用戶服務(wù)條款》

OpenStack云平臺Train版搭建與基礎(chǔ)環(huán)境準(zhǔn)備的方法是什么

發(fā)布時間:2023-03-29 13:48:05 來源:億速云 閱讀:146 作者:iii 欄目:開發(fā)技術(shù)

這篇文章主要介紹了OpenStack云平臺Train版搭建與基礎(chǔ)環(huán)境準(zhǔn)備的方法是什么的相關(guān)知識,內(nèi)容詳細(xì)易懂,操作簡單快捷,具有一定借鑒價值,相信大家閱讀完這篇OpenStack云平臺Train版搭建與基礎(chǔ)環(huán)境準(zhǔn)備的方法是什么文章都會有所收獲,下面我們一起來看看吧。

OpenStack簡介

OpenStack是由美國國家航空航天局NASA)與Rackspace公司合作研發(fā)并發(fā)起的,以Apache許可證授權(quán)的自由軟件和開放源代碼的云計(jì)算技術(shù)解決方案,其是一個項(xiàng)目也是一個軟件,主要用于實(shí)現(xiàn)云項(xiàng)目,以云項(xiàng)目操作系統(tǒng)而存在。作用: 用于部署公有云、私有云,并實(shí)現(xiàn)對云項(xiàng)目管理。

開發(fā)語言: Python

 一、環(huán)境準(zhǔn)備

名稱IP地址主機(jī)名稱備注
控制節(jié)點(diǎn)192.168.124.88controller最小4G,開啟虛擬化
計(jì)算節(jié)點(diǎn)192.168.124.89computel最小2G,開啟虛擬化

1.1、關(guān)閉selinxu

[root@localhost ~]# setenforce 0
[root@localhost ~]# vi /etc/selinux/config 
[root@localhost ~]# sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config

1.2、關(guān)閉防火墻

[root@localhost ~]# systemctl stop firewalld
[root@localhost ~]# systemctl disable firewalld
Removed symlink /etc/systemd/system/multi-user.target.wants/firewalld.service.
Removed symlink /etc/systemd/system/dbus-org.fedoraproject.FirewallD1.service.

1.3、修改主機(jī)名

[root@localhost ~]# hostnamectl set-hostname controller
[root@localhost ~]# hostnamectl set-hostname computer

1.4、配置時間同步服務(wù)器

[root@computer ~]# yum install -y chrony
[root@controller ~]# yum install -y chrony
  • controller修改時間同步服務(wù)器配置: 

[root@controller ~]# vi /etc/chrony.conf

OpenStack云平臺Train版搭建與基礎(chǔ)環(huán)境準(zhǔn)備的方法是什么

  • computer修改時間同步服務(wù)器配置: 

[root@computer ~]# vi /etc/chrony.conf

OpenStack云平臺Train版搭建與基礎(chǔ)環(huán)境準(zhǔn)備的方法是什么

  •  兩個節(jié)點(diǎn)都重啟時間同步服務(wù)器

[root@controller ~]# systemctl restart chronyd
  • 查看一下已經(jīng)同步好了

[root@controller ~]# chronyc sources
210 Number of sources = 1
MS Name/IP address         Stratum Poll Reach LastRx Last sample               
===============================================================================
^* 203.107.6.88                  2   6    17    50  +2663us[+4287us] +/-   30ms
[root@controller ~]# date 
Tue Feb  7 10:06:43 EST 2023

1.5、配置域名

[root@controller ~]# vi /etc/hosts
[root@computer ~]# vi /etc/hosts

OpenStack云平臺Train版搭建與基礎(chǔ)環(huán)境準(zhǔn)備的方法是什么

 二、安裝OpenStack庫

2.1、啟用OpenStack倉庫的包

[root@controller ~]# yum install centos-release-openstack-train -y
[root@computer ~]# yum install centos-release-openstack-train -y

2.2、安裝python-openstackclient

先安裝源

[root@controller ~]# yum install python-openstackclient -y
[root@computer ~]# yum install centos-release-openstack-train -y

繼續(xù)安裝

[root@controller ~]# yum install openstack-selinux -y
[root@computer ~]# yum install openstack-selinux -y

2.3、controller安裝數(shù)據(jù)庫

[root@controller ~]# yum install mariadb mariadb-server python2-PyMySQL -y

 創(chuàng)建配置并修改IP

[root@controller ~]# vi /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 192.168.124.88
 
default-storage-engine = innodb
innodb_file_per_table = on
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
~

重啟數(shù)據(jù)庫 

[root@controller ~]# systemctl enable mariadb.service[root@controller ~]# systemctl start mariadb.service

初始化數(shù)據(jù)庫

[root@controller ~]# mysql_secure_installation
 
NOTE: RUNNING ALL PARTS OF THIS SCRIPT IS RECOMMENDED FOR ALL MariaDB
      SERVERS IN PRODUCTION USE!  PLEASE READ EACH STEP CAREFULLY!
 
In order to log into MariaDB to secure it, we'll need the current
password for the root user.  If you've just installed MariaDB, 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 MariaDB
root user without the proper authorisation.
 
Set root password? [Y/n] y
New password: 
Re-enter new password: 
Password updated successfully!
Reloading privilege tables..
 ... Success!
 
 
By default, a MariaDB installation has an anonymous user, allowing anyone
to log into MariaDB 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
 ... 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
 ... skipping.
 
By default, MariaDB 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
 - 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
 ... Success!
 
Cleaning up...
 
All done!  If you've completed all of the above steps, your MariaDB
installation should now be secure.
 
Thanks for using MariaDB!

輸入密碼(這里輸入123密碼)

2.4、安裝消息隊(duì)列

[root@controller ~]# yum install rabbitmq-server -y

重啟

[root@controller ~]# systemctl enable rabbitmq-server.service
[root@controller ~]# systemctl start rabbitmq-server.service

 增加用戶

[root@controller ~]# rabbitmqctl add_user openstack 123Creating user "openstack"

開放權(quán)限

[root@controller ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"Setting permissions for user "openstack" in vhost "/"

 #下面引住的不需要做

(這里不需要做)查看消息隊(duì)列有的服務(wù)

[root@controller ~]# rabbitmq-plugins list

(這里不需要做)打開這兩個服務(wù)開啟圖像化界面

[root@controller ~]# rabbitmq-plugins enable rabbitmq_management rabbitmq_management_agent

(這里不需要做)查看端口

[root@controller ~]# ss  -tln
State       Recv-Q Send-Q                     Local Address:Port                                    Peer Address:Port              
LISTEN      0      128                                    *:25672                                              *:*                  
LISTEN      0      128                       192.168.124.88:3306                                               *:*                  
LISTEN      0      128                                    *:4369                                               *:*                  
LISTEN      0      128                                    *:22                                                 *:*                  
LISTEN      0      128                                    *:15672                                              *:*                  
LISTEN      0      100                            127.0.0.1:25                                                 *:*                  
LISTEN      0      128                                   :::5672                                              :::*                  
LISTEN      0      128                                   :::22                                                :::*                  
LISTEN      0      100                                  ::1:25                                                :::*

(這里不需要做)通過15672端口可以登錄消息隊(duì)列用戶:guest 密碼:guest

OpenStack云平臺Train版搭建與基礎(chǔ)環(huán)境準(zhǔn)備的方法是什么

2.5、配置緩存

[root@controller ~]# yum install memcached python-memcached -y
[root@controller ~]# vi /etc/sysconfig/memcached

修改配置文件 

PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="1024"
OPTIONS="-l 127.0.0.1,::1,controller"
~
[root@controller ~]# systemctl enable memcached.service
[root@controller ~]# systemctl start memcached.service

查看一下配置

[root@controller ~]# cat /etc/sysconfig/memcached 
PORT="11211"
USER="memcached"
MAXCONN="1024"
CACHESIZE="1024"
OPTIONS="-l 127.0.0.1,::1,controller"

2.6、配置etcd(這次不用,所以沒有裝)

下面我們開始安裝部署組件,下一篇開始安裝Keystone

ldentity 身份認(rèn)證

代號: Keystone

為OpenStack中其它服務(wù)提供身份驗(yàn)證、服務(wù)注冊、服務(wù)令牌等功能。

關(guān)于“OpenStack云平臺Train版搭建與基礎(chǔ)環(huán)境準(zhǔn)備的方法是什么”這篇文章的內(nèi)容就介紹到這里,感謝各位的閱讀!相信大家對“OpenStack云平臺Train版搭建與基礎(chǔ)環(huán)境準(zhǔn)備的方法是什么”知識都有一定的了解,大家如果還想學(xué)習(xí)更多知識,歡迎關(guān)注億速云行業(yè)資訊頻道。

向AI問一下細(xì)節(jié)

免責(zé)聲明:本站發(fā)布的內(nèi)容(圖片、視頻和文字)以原創(chuàng)、轉(zhuǎn)載和分享為主,文章觀點(diǎn)不代表本網(wǎng)站立場,如果涉及侵權(quán)請聯(lián)系站長郵箱:is@yisu.com進(jìn)行舉報,并提供相關(guān)證據(jù),一經(jīng)查實(shí),將立刻刪除涉嫌侵權(quán)內(nèi)容。

AI