Openstack安装部署
系統(tǒng)版本 rhel7.4
關(guān)閉 iptables
關(guān)閉 selinux
foundation1: 172.25.254.1
server1: 172.25.254.11
server2: 172.25.254.12
可參考:https://docs.openstack.org/mitaka/zh_CN/install-guide-rdo/????????????????? //選擇的mitaka
?
虛擬機上網(wǎng)
首先物理機必須可以上網(wǎng),
[root@foundation1 Desktop]# iptables -t nat -I POSTROUTING -s 172.25.254.0/24 -j MASQUERADE?? //允許虛擬機所在的網(wǎng)段
[root@foundation1 Desktop]# iptables -t nat -nL?????????? //查看防火墻策略
server1和server2均操作:
[root@server2 ~]# route add default gw 172.25.254.1
[root@server2 ~]# route -n
[root@server2 ~]# vim /etc/resolv.conf
nameserver 114.114.114.114
[root@server2 ~]# ping baidu.com????????????????????????? //此時可以上網(wǎng)了
掛載鏡像
下載rhel7.4的鏡像和mitaka.tar鏡像
鏡像mitaka.tar在 https://pan.baidu.com/disk/home?#/all?vmode=list&path=%2F%E6%88%91%E7%9A%84%E8%B5%84%E6%BA%90
[root@foundation1 Desktop]# mount /home/kiosk/Desktop/Mitaka.iso /var/www/html/mitaka/
server1和server2均操作:
[root@server1 ~]# vim /etc/yum.repos.d/dvd.repo
[rhel7.4]
name=rhel7.4
baseurl=http://172.25.254.1/rhel7.4
gpgcheck=0
enabled=1
[mitaka]
name=mitaka
baseurl=http://172.25.254.1/mitaka/Openstack-Mitaka
gpgcheck=0
?
在主機上升級包:
安裝 Openstack客戶端:
兩個節(jié)點都要操作
[root@server1 ~]# yum install -y python-openstackclient
[root@server2 ~]# yum install openstack-selinux
[root@server1 ~]# yum upgrade
[root@server2 ~]# yum upgrade
[root@server2 ~]# yum install -y python-openstackclient
[root@server2 ~]# yum install openstack-selinux
安全并配置組件?
以下操作控制節(jié)點上
[root@server1 ~]# yum install -y mariadb mariadb-server python2-PyMySQL
//在 [mysqld] 部分,設(shè)置 ``bind-address``值為控制節(jié)點的管理網(wǎng)絡(luò)IP地址以使得其它節(jié)點可以通過管理網(wǎng)絡(luò)訪問數(shù)據(jù)庫:
[root@server1 ~]# vim /etc/my.cnf.d/openstack.cnf
[mysqld]
bind-address = 172.25.254.11
default-storage-engine = innodb
innodb_file_per_table
max_connections = 4096
collation-server = utf8_general_ci
character-set-server = utf8
完成安裝
[root@server1 ~]# systemctl enable mariadb.service
[root@server1 ~]# systemctl start mariadb.service
//為了保證數(shù)據(jù)庫服務(wù)的安全性,運行``mysql_secure_installation``腳本。特別需要說明的是,為數(shù)據(jù)庫的root用戶設(shè)置一個適當(dāng)?shù)拿艽a。
[root@server1 ~]# mysql_secure_installation
安裝MongoDB包:
[root@server1 ~]# yum install mongodb-server mongodb
[root@server1 ~]# vim /etc/mongod.conf
bind_ip = 172.25.254.11
默認情況下,MongoDB會在``/var/lib/mongodb/journal`` 目錄下創(chuàng)建幾個 1 GB 大小的日志文件。如果你想將每個日志文件大小減小到128MB并且限制日志文件占用的總空間為512MB,配置 smallfiles 的值:
完成安裝
啟動MongoDB 并配置它隨系統(tǒng)啟動:
[root@server1 ~]# systemctl enable mongod.service
[root@server1 ~]# systemctl start mongod.service
消息隊列
安全并配置組件
1.安裝包:
[root@server1 ~]# yum install -y rabbitmq-server
2.啟動消息隊列服務(wù)并將其配置為隨系統(tǒng)啟動:
[root@server1 ~]# systemctl enable rabbitmq-server.service
[root@server1 ~]# systemctl start rabbitmq-server.service
3.查看端口:
[root@server1 ~]# netstat -antlp | grep :5672
添加 openstack 用戶,密碼 為openstack
[root@server1 ~]# rabbitmqctl add_user openstack openstack
給``openstack``用戶配置寫和讀權(quán)限:
[root@server1 ~]# rabbitmqctl set_permissions openstack ".*" ".*" ".*"
[root@server1 ~]# rabbitmq-plugins list
[root@server1 ~]# rabbitmq-plugins enable rabbitmq_management
[root@server1 ~]# netstat -antlp | grep :15672
訪問 http://172.25.254.11:15672/
Memcached
認證服務(wù)認證緩存使用Memcached緩存令牌。緩存服務(wù)memecached運行在控制節(jié)點。在生產(chǎn)部署中,我們推薦聯(lián)合啟用防火墻、認證和加密保證它的安全。
安全并配置組件
[root@server1 ~]# yum install memcached python-memcached
啟動 memcached
[root@server1 ~]# systemctl enable memcached.service
[root@server1 ~]# systemctl start memcached.service
認證服務(wù)
Openstack 身份認證服務(wù)
在控制節(jié)點
進入 mysql 創(chuàng)建 keystone 數(shù)據(jù)庫并授予權(quán)限
在你配置 OpenStack 身份認證服務(wù)前,你必須創(chuàng)建一個數(shù)據(jù)庫和管理員令牌。
1、完成下面的步驟以創(chuàng)建數(shù)據(jù)庫
>數(shù)據(jù)庫連接客戶端以 root 用戶連接到數(shù)據(jù)庫服務(wù)器:
[root@server1 ~]# mysql -uroot -p??????? //我在這里的密碼是redhat
>創(chuàng)建 keystone 數(shù)據(jù)庫:
MariaDB [(none)]> create database keystone;
>對``keystone``數(shù)據(jù)庫授予恰當(dāng)?shù)臋?quán)限:
MariaDB [(none)]> grant all privileges on keystone.* to 'keystone'@'localhost' identified by 'keystone';
>退出數(shù)據(jù)庫客戶端。
MariaDB [(none)]> exit
2、 生成一個隨機值在初始的配置中作為管理員的令牌。
[root@server1 ~]# openssl rand -hex 10
29c27f7d00a35bc3380a
安全并配置組件
運行以下命令來安裝 httpd,mod_wsgi,keystoen
[root@server1 ~]# yum install -y openstack-keystone httpd mod_wsgi
3、編輯文件 /etc/keystone/keystone.conf 并完成如下動作:
[root@server1 ~]# vim /etc/keystone/keystone.conf
[DEFAULT]????????????????????????????? ? ? ? ? ? ? ? ? ? ? ? ?? //在``[DEFAULT]``部分,定義初始管理令牌的值
admin_token = 29c27f7d00a35bc3380a???????????????????
[database]
connection = mysql+pymysql://keystone:keystone@controller/keystone?????????? //在 [database] 部分,配置數(shù)據(jù)庫訪問
[token]
provider = fernet???????????????????????????? //在``[token]``部分,配置Fernet UUID令牌的提供者。
4、初始化身份認證服務(wù)的數(shù)據(jù)庫:
[root@server1 ~]# su -s /bin/sh -c "keystone-manage db_sync" keystone
5、初始化Fernet keys:
[root@server1 ~]# keystone-manage fernet_setup --keystone-user keystone --keystone-group keystone
配置 Apache HTTP 服務(wù)器
1、編輯``/etc/httpd/conf/httpd.conf`` 文件,配置``ServerName`` 選項為控制節(jié)點:
[root@server1 ~]# vim /etc/httpd/conf/httpd.conf
ServerName controller
2、用下面的內(nèi)容創(chuàng)建文件 /etc/httpd/conf.d/wsgi-keystone.conf。
[root@server1 ~]# vim /etc/httpd/conf.d/wsgi-keystone.conf
Listen 5000
Listen 35357
<VirtualHost *:5000>
??? WSGIDaemonProcess keystone-public processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
??? WSGIProcessGroup keystone-public
??? WSGIScriptAlias / /usr/bin/keystone-wsgi-public
??? WSGIApplicationGroup %{GLOBAL}
??? WSGIPassAuthorization On
??? ErrorLogFormat "%{cu}t %M"
??? ErrorLog /var/log/httpd/keystone-error.log
??? CustomLog /var/log/httpd/keystone-access.log combined
??? <Directory /usr/bin>
??????? Require all granted
??? </Directory>
</VirtualHost>
<VirtualHost *:35357>
??? WSGIDaemonProcess keystone-admin processes=5 threads=1 user=keystone group=keystone display-name=%{GROUP}
??? WSGIProcessGroup keystone-admin
??? WSGIScriptAlias / /usr/bin/keystone-wsgi-admin
??? WSGIApplicationGroup %{GLOBAL}
??? WSGIPassAuthorization On
??? ErrorLogFormat "%{cu}t %M"
??? ErrorLog /var/log/httpd/keystone-error.log
??? CustomLog /var/log/httpd/keystone-access.log combined
??? <Directory /usr/bin>
??????? Require all granted
??? </Directory>
</VirtualHost>
啟動 Apache HTTP 服務(wù):
[root@server1 ~]# systemctl enable httpd.service
[root@server1 ~]# systemctl start httpd.service
創(chuàng)建服務(wù)實體和API端點
1、配置認證令牌:
[root@server1 ~]# export OS_TOKEN=29c27f7d00a35bc3380a
2、配置端點URL:
[root@server1 ~]# export OS_URL=http://controller:35357/v3
3、配置認證 API 版本:
[root@server1 ~]# export OS_IDENTITY_API_VERSION=3
創(chuàng)建服務(wù)實體和API端點
1、在你的Openstack環(huán)境中,認證服務(wù)管理服務(wù)目錄。服務(wù)使用這個目錄來決定您的環(huán)境中可用的服務(wù)。
>創(chuàng)建服務(wù)實體和身份認證服務(wù):
[root@server1 ~]# openstack service create --name keystone --description "OpenStack Identity" identity
>創(chuàng)建認證服務(wù)的 API 端點:
[root@server1 ~]# openstack endpoint create --region RegionOne identity public http://controller:5000/v3
[root@server1 ~]# openstack endpoint create --region RegionOne identity admin http://controller:35357/v3
創(chuàng)建域、項目、用戶和角色
1.創(chuàng)建域``default``:
[root@server1 ~]# openstack domain create --description "Default Domain" default
2.在你的環(huán)境中,為進行管理操作,創(chuàng)建管理的項目、用戶和角色:
>創(chuàng)建 admin 項目
[root@server1 ~]# openstack project create --domain default --description "Admin Project" admin
>創(chuàng)建 admin 用戶
[root@server1 ~]# openstack user create --domain default --password-prompt admin
>創(chuàng)建 admin 角色
[root@server1 ~]# openstack role create admin
>添加``admin`` 角色到 admin 項目和用戶上:
[root@server1 ~]# $ openstack role add --project admin --user admin admin????????? //這個命令執(zhí)行后沒有輸出。
3.本指南使用一個你添加到你的環(huán)境中每個服務(wù)包含獨有用戶的service 項目。創(chuàng)建``service``項目:
[root@server1 ~]# openstack project create --domain default? --description "Service Project" service
4.常規(guī)(非管理)任務(wù)應(yīng)該使用無特權(quán)的項目和用戶。作為例子,本指南創(chuàng)建 demo 項目和用戶。
>創(chuàng)建``demo`` 項目:
[root@server1 ~]# penstack project create --domain default --description "Demo Project" demo
//當(dāng)為這個項目創(chuàng)建額外用戶時,不要重復(fù)這一步。
>創(chuàng)建``demo`` 用戶:
[root@server1 ~]#? openstack user create --domain default --password-prompt demo
>創(chuàng)建 user 角色:
[root@server1 ~]#? openstack role create user
>添加 user``角色到 ``demo 項目和用戶:
[root@server1 ~]# openstack role add --project demo --user demo user
//你可以重復(fù)此過程來創(chuàng)建額外的項目和用戶。
驗證操作
//在控制節(jié)點上執(zhí)行這些命令。
1.重置``OS_TOKEN``和``OS_URL`` 環(huán)境變量:
unset OS_TOKEN OS_URL
2.作為 admin 用戶,請求認證令牌:
[root@server1 ~]# openstack --os-auth-url http://controller:35357/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name admin --os-username admin token issue?????????? //這個命令使用``admin``用戶的密碼。
3.作為``demo`` 用戶,請求認證令牌:
[root@server1 ~]# openstack --os-auth-url http://controller:5000/v3 --os-project-domain-name default --os-user-domain-name default --os-project-name demo --os-username demo token issue
//這個命令使用``demo`` 用戶的密碼和API端口5000,這樣只會允許對身份認證服務(wù)API的常規(guī)(非管理)訪問。
創(chuàng)建 OpenStack 客戶端環(huán)境腳本
創(chuàng)建腳本
1.編輯文件 admin-openrc 并添加如下內(nèi)容:
[root@server1 ~]# vim admin-openrc?????????????????????????? //將 ADMIN_PASS 為在認證服務(wù)中為 admin 用戶選擇的密碼,我的為westos
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=admin
export OS_USERNAME=admin
export OS_PASSWORD=westos
export OS_AUTH_URL=http://controller:35357/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
2.編輯文件 demo-openrc 并添加如下內(nèi)容:
[root@server1 ~]# vim demo-openrc????????????????? //將 DEMO_PASS 為在認證服務(wù)中為 demo 用戶選擇的密碼,我這里也是westos
export OS_PROJECT_DOMAIN_NAME=default
export OS_USER_DOMAIN_NAME=default
export OS_PROJECT_NAME=demo
export OS_USERNAME=demo
export OS_PASSWORD=westos
export OS_AUTH_URL=http://controller:5000/v3
export OS_IDENTITY_API_VERSION=3
export OS_IMAGE_API_VERSION=2
使用腳本
1.加載``admin-openrc``文件來身份認證服務(wù)的環(huán)境變量位置和``admin``項目和用戶證書:
[root@server1 ~]# . admin-openrc
2.請求認證令牌:
[root@server1 ~]# openstack token issue
鏡像服務(wù)
OpenStack鏡像服務(wù)包括以下組件:
glance-api?? :接收鏡像API的調(diào)用,諸如鏡像發(fā)現(xiàn)、恢復(fù)、存儲。
glance-registry?? :存儲、處理和恢復(fù)鏡像的元數(shù)據(jù),元數(shù)據(jù)包括項諸如大小和類型。
數(shù)據(jù)庫? :存放鏡像元數(shù)據(jù),用戶是可以依據(jù)個人喜好選擇數(shù)據(jù)庫的,多數(shù)的部署使用MySQL或SQLite。
鏡像文件的存儲倉庫:支持多種類型的倉庫,它們有普通文件系統(tǒng)、對象存儲、RADOS塊設(shè)備、HTTP、以及亞馬遜S3。記住,其中一些倉庫僅支持只讀方式使用。
元數(shù)據(jù)定義服務(wù):通用的API,是用于為廠商,管理員,服務(wù),以及用戶自定義元數(shù)據(jù)。這種元數(shù)據(jù)可用于不同的資源,例如鏡像,工件,卷,配額以及集合。一個定義包括了新屬性的鍵,描述,約束以及可以與之關(guān)聯(lián)的資源的類型。
安裝和配置
安裝和配置鏡像服務(wù)之前,你必須創(chuàng)建創(chuàng)建一個數(shù)據(jù)庫、服務(wù)憑證和API端點。
1.完成下面的步驟以創(chuàng)建數(shù)據(jù)庫:
>用數(shù)據(jù)庫連接客戶端以 root 用戶連接到數(shù)據(jù)庫服務(wù)器:
[root@server1 ~]# mysql -u root -p
>創(chuàng)建 glance 數(shù)據(jù)庫:
>對``glance``數(shù)據(jù)庫授予恰當(dāng)?shù)臋?quán)限:
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY 'glance';
Query OK, 0 rows affected (0.00 sec)
MariaDB [(none)]> GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY 'glance';
?
>退出數(shù)據(jù)庫客戶端。
2.獲得 admin 憑證來獲取只有管理員能執(zhí)行的命令的訪問權(quán)限:
[root@server1 ~]# . admin-openrc
3.要創(chuàng)建服務(wù)證書,完成這些步驟:
>創(chuàng)建 glance 用戶:
[root@server1 ~]# openstack user create --domain default --password-prompt glance
>添加 admin 角色到 glance 用戶和 service 項目上。
[root@server1 ~]# openstack role add --project service --user glance admin????????????? //這個命令執(zhí)行后沒有輸出。
>創(chuàng)建``glance``服務(wù)實體:
[root@server1 ~]# openstack service create --name glance --description "OpenStack Image" image
>創(chuàng)建鏡像服務(wù)的 API 端點:
[root@server1 ~]# openstack endpoint create --region RegionOne image public http://controller:9292
[root@server1 ~]# openstack endpoint create --region RegionOne image internal http://controller:9292
[root@server1 ~]# openstack endpoint create --region RegionOne? image admin http://controller:9292
安全并配置組件
1.安裝軟件包:
[root@server1 ~]# yum install openstack-glance
2.編輯文件 /etc/glance/glance-api.conf 并完成如下動作:
[root@server1 ~]# vim /etc/glance/glance-api.conf
>在 [database] 部分,配置數(shù)據(jù)庫訪問:
[database]
connection = mysql+pymysql://glance:glance@controller/glance
>在 [keystone_authtoken] 和 [paste_deploy] 部分,配置認證服務(wù)訪問:
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance????????????????
[paste_deploy]
flavor = keystone
//GLANCE_PASS 為認證服務(wù)中 glance 用戶選擇的密碼。
//在 [keystone_authtoken] 中注釋或者刪除其他選項。
>在 [glance_store] 部分,配置本地文件系統(tǒng)存儲和鏡像文件位置
[glance_store]
stores = file,http
default_store = file
filesystem_store_datadir = /var/lib/glance/images/
3.編輯文件 ``/etc/glance/glance-registry.conf``并完成如下動作:
[root@server1 ~]# vim /etc/glance/glance-registry.conf
>在 [database] 部分,配置數(shù)據(jù)庫訪問:
[database]
connection = mysql+pymysql://glance:glance@controller/glance
>在 [keystone_authtoken] 和 [paste_deploy] 部分,配置認證服務(wù)訪問:
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = glance
password = glance
[paste_deploy]
flavor = keystone
//密碼為鏡像服務(wù)選擇的密碼。
4.寫入鏡像服務(wù)數(shù)據(jù)庫
[root@server1 ~]# su -s /bin/sh -c "glance-manage db_sync" glance
查看 glance 數(shù)據(jù)庫是否有數(shù)據(jù)已經(jīng)同步:
[root@server1 ~]# mysql -uroot -p
MariaDB [(none)]> use glance;
MariaDB [glance]> show tables;
完成安裝
啟動鏡像服務(wù):
[root@server1 ~]# systemctl enable openstack-glance-api.service openstack-glance-registry.service
[root@server1 ~]# systemctl start openstack-glance-api.service openstack-glance-registry.service
?
驗證操作
在控制節(jié)點上執(zhí)行這些命令
1.獲得 admin 憑證來獲取只有管理員能執(zhí)行的命令的訪問權(quán)限:
[root@server1 ~]# . admin-openrc
[root@server1 ~]# wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
-bash: wget: command not found????????????????????????? //沒有此命令
如果您的發(fā)行版里沒有包含wget,請安裝它
[root@server1 ~]# yum install -y wget????????? //進行下載
2.下載源鏡像:
[root@server1 ~]# wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img
該過程下載有點慢
3.使用 QCOW2 磁盤格式, bare 容器格式上傳鏡像到鏡像服務(wù)并設(shè)置公共可見,這樣所有的項目都可以訪問它:
[root@server1 ~]# openstack image create "cirros" --file cirros-0.3.4-x86_64-disk.img --disk-format qcow2 --container-format bare --public
4.確認鏡像的上傳并驗證屬性:
[root@server1 ~]# openstack image list
計算服務(wù)概覽
OpenStack計算服務(wù)由下列組件所構(gòu)成:
nova-api 服務(wù)
nova-api-metadata 服務(wù)
``nova-compute``服務(wù)
``nova-scheduler``服務(wù)
``nova-conductor``模塊
``nova-cert``模塊
nova-network worker 守護進程
nova-consoleauth 守護進程
nova-novncproxy 守護進程
nova-spicehtml5proxy 守護進程
nova-xvpvncproxy 守護進程
nova-cert 守護進程
``nova``客戶端
隊列
SQL數(shù)據(jù)庫
安裝并配置控制節(jié)點
這個部分將描述如何在控制節(jié)點上安裝和配置 Compute 服務(wù)
1.為了創(chuàng)建數(shù)據(jù)庫,必須完成這些步驟:
>用數(shù)據(jù)庫連接客戶端以 root 用戶連接到數(shù)據(jù)庫服務(wù)器:
[root@server1 ~]# mysql -u root -p
>創(chuàng)建 nova_api 和 nova 數(shù)據(jù)庫:
MariaDB [(none)]> CREATE DATABASE nova_api;
MariaDB [(none)]> CREATE DATABASE nova;
>對數(shù)據(jù)庫進行正確的授權(quán):
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'localhost'
??? -> IDENTIFIED BY 'nova';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova_api.* TO 'nova'@'%'
??? -> IDENTIFIED BY 'nova';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localhost'
??? -> IDENTIFIED BY 'nova';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'%'
??? -> IDENTIFIED BY 'nova';
>退出數(shù)據(jù)庫客戶端。
2.獲得 admin 憑證來獲取只有管理員能執(zhí)行的命令的訪問權(quán)限:
[root@server1 ~]# . admin-openrc
3.要創(chuàng)建服務(wù)證書,完成這些步驟:
>創(chuàng)建 nova 用戶:
[root@server1 ~]# openstack user create --domain default --password-prompt nova
>給 nova 用戶添加 admin 角色:
[root@server1 ~]# $ openstack role add --project service --user nova admin
>創(chuàng)建 nova 服務(wù)實體:
[root@server1 ~]# openstack service create --name nova --description "OpenStack Compute" compute
4.創(chuàng)建 Compute 服務(wù) API 端點 :
[root@server1 ~]# openstack endpoint create --region RegionOne compute public http://controller:8774/v2.1/%\(tenant_id\)s
[root@server1 ~]# openstack endpoint create --region RegionOne compute internal http://controller:8774/v2.1/%\(tenant_id\)s
[root@server1 ~]# openstack endpoint create --region RegionOne compute admin http://controller:8774/v2.1/%\(tenant_id\)s
安全并配置組件
1.安裝軟件包:
[root@server1 ~]# yum install openstack-nova-api openstack-nova-conductor?? openstack-nova-console openstack-nova-novncproxy?? openstack-nova-scheduler
2.編輯``/etc/nova/nova.conf``文件并完成下面的操作:
[root@server1 ~]# vim /etc/nova/nova.conf
>在``[DEFAULT]``部分,只啟用計算和元數(shù)據(jù)API:
[DEFAULT]
enabled_apis = osapi_compute,metadata
>在``[api_database]``和``[database]``部分,配置數(shù)據(jù)庫的連接:
api_database]
connection = mysql+pymysql://nova:nova@controller/nova_api
[database]
connection = mysql+pymysql://nova:nova@controller/nova
>在 “[DEFAULT]” 和 “[oslo_messaging_rabbit]”部分,配置 “RabbitMQ” 消息隊列訪問:
[DEFAULT]
rpc_backend = rabbit
[oslo_messaging_rabbit]
rabbit_host = controller
rabbit_userid = openstack
rabbit_password = openstack
[DEFAULT]
auth_strategy = keystone
[keystone_authtoken]
auth_uri = http://controller:5000
auth_url = http://controller:35357
memcached_servers = controller:11211
auth_type = password
project_domain_name = default
user_domain_name = default
project_name = service
username = nova
password = nova
>在 [DEFAULT 部分,配置``my_ip`` 來使用控制節(jié)點的管理接口的IP 地址。
[DEFAULT]
my_ip = 172.25.254.11
>在 [DEFAULT] 部分,使能 Networking 服務(wù):
[DEFAULT]
use_neutron = True
firewall_driver = nova.virt.firewall.NoopFirewallDriver
>在``[vnc]``部分,配置VNC代理使用控制節(jié)點的管理接口IP地址 :
[vnc]
vncserver_listen = $my_ip
vncserver_proxyclient_address = $my_ip
>在 [glance] 區(qū)域,配置鏡像服務(wù) API 的位置:
[glance]
api_servers = http://controller:9292
>在 [oslo_concurrency] 部分,配置鎖路徑:
[oslo_concurrency]
lock_path = /var/lib/nova/tmp
3.同步Compute 數(shù)據(jù)庫:
[root@server1 ~]# su -s /bin/sh -c "nova-manage api_db sync" nova
[root@server1 ~]# su -s /bin/sh -c "nova-manage db sync" nova
察看是否已經(jīng)同步
[root@server1 ~]# mysql -p
MariaDB [(none)]> use nova;
MariaDB [nova_api]> show tables;
MariaDB [nova]> use nova_api;
MariaDB [nova_api]> show tables;
完成安裝
啟動 Compute 服務(wù)并將其設(shè)置為隨系統(tǒng)啟動:
[root@server1 ~]# systemctl enable openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
[root@server1 ~]# systemctl start openstack-nova-api.service openstack-nova-consoleauth.service openstack-nova-scheduler.service openstack-nova-conductor.service openstack-nova-novncproxy.service
?
安裝和配置計算節(jié)點
nova 計算節(jié)點上主要有組件:nova-compute
安全并配置組件
1.安裝軟件包:
[root@server1 ~]# yum install openstack-nova-compute
2.編輯``/etc/nova/nova.conf``文件并完成下面的操作:
[root@server1 ~]# vim /etc/nova/nova.conf
>在``[DEFAULT]`` 和 [oslo_messaging_rabbit]部分,配置``RabbitMQ``消息隊列的連接:
?
>在 “[DEFAULT]” 和 “[keystone_authtoken]” 部分,配置認證服務(wù)訪問:
>在 [DEFAULT] 部分,配置 my_ip 選項:
>在 [DEFAULT] 部分,使能 Networking 服務(wù):
>在``[vnc]``部分,啟用并配置遠程控制臺訪問:
>在 [glance] 區(qū)域,配置鏡像服務(wù) API 的位置:
>在 [oslo_concurrency] 部分,配置鎖路徑:
完成安裝
?
?
?
?
?
剩余小部分待完成
總結(jié)
以上是生活随笔為你收集整理的Openstack安装部署的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: mysql 主从复制 和基于gtid的m
- 下一篇: rhel-server-7.5-x86_