您好,登錄后才能下訂單哦!
glance鏡像服務
官方文檔:https://docs.openstack.org/glance/stein/install/install-rdo.html#install-and-configure-components
一、數據庫
1、 創建數據庫
mysql?-uroot?-p123456 MariaDB?[(none)]>?CREATE?DATABASE?glance;
2、 創建用戶
GRANT?ALL?PRIVILEGES?ON?glance.*?TO?'glance'@'%'?IDENTIFIED?BY?'glance123';
測試能否連接#? mysql -uglance -pglance123 -hopenstack-mysql.heng.net
二、創建相應的服務并注冊api
1、導入admin賬號的變量,創建glance用戶,并加入admin角色組
source?scripts/admin-stein.sh openstack?user?create?--domain?default?--password-prompt?glance 密碼glance openstack?role?add?--project?service?--user?glance?admin
2、創建image服務
[root@controller1 ~]#openstack service create --name glance --description "OpenStack Image" image
+-------------+----------------------------------+
| Field?????? | Value???????????????? ???????????|
+-------------+----------------------------------+
| description | OpenStack Image????????????????? |
| enabled???? | True???????????????????????????? |
| id????????? | 1616cdd9d4f54f87812dc183321cdcf1 |
| name??????? | glance???????????????? ??????????|
| type??????? | image??????????????????????????? |
+-------------+----------------------------------+
3、注冊后端api
openstack endpoint create --region RegionOne image public http://openstack-vip.heng.net:9292
openstack endpoint create --region RegionOne image internal http://openstack-vip.heng.net:9292
openstack endpoint create --region RegionOne image admin http://openstack-vip.heng.net:9292
三、安裝對應服務的軟件包并修改配置文件
1、安裝openstack-glance客戶端(先安裝后注冊服務也可以)
yum?install?openstack-glance
2、為了實現以后實現控制端的高可用,將鏡像放在nfs上,配置nfs
在數據庫和控制端上安裝nfs
yum?install?nfs-utils?-y
vi /etc/exports
/data/openstack/images?*(rw,no_root_squash)
mkdir -p /data/openstack/images
systemctl start nfs
systemctl enable nfs?
控制端測試
showmount? -e 192.168.12.19
3、修改配置文件glance-api.conf
vi /etc/glance/glance-api.conf
[database] connection?=?mysql+pymysql://glance:glance123@openstack-mysql.heng.net/glance ? [keystone_authtoken] www_authenticate_uri?=?http://openstack-vip.heng.net:5000 auth_url?=?http://openstack-vip.heng.net:5000 memcached_servers?=?openstack-mysql.heng.net:11211???memcached在mysql上 auth_type?=?password project_domain_name?=?Default user_domain_name?=?Default project_name?=?service username?=?glance password?=?glance???glance賬戶的密碼 ? [paste_deploy] flavor?=?keystone???認證方式取消注釋即可,所有服務認證方式都是keystone ? [glance_store] stores?=?file,http default_store?=?file filesystem_store_datadir?=?/var/lib/glance/images/
4、修改配置文件/etc/glance/glance-registry.conf
vi /etc/glance/glance-registry.conf
[database] connection?=?mysql+pymysql://glance:glance123@openstack-mysql.heng.net/glance ? [keystone_authtoken] ? www_authenticate_uri?=?http://openstack-vip.heng.net:5000 auth_url?=?http://openstack-vip.heng.net:5000 memcached_servers?=?openstack-mysql.heng.net:11211 auth_type?=?password project_domain_name?=?Default user_domain_name?=?Default project_name?=?service username?=?glance password?=?glance ? [paste_deploy] ? flavor?=?keystone
5、初始化數據庫
su?-s?/bin/sh?-c?"glance-manage?db_sync"?glance
6、啟動服務,并設置開機啟動
systemctl?enable?openstack-glance-api.service?openstack-glance-registry.service systemctl?start?openstack-glance-api.service?openstack-glance-registry.service
7、掛載nfs
啟動服務之后自動生成/var/lib/glance/images
ll?/var/lib/glance/images?-d
停止第6步的服務再掛載
vi /etc/fstab? 設置自動掛載, _netdev表示無法掛載跳過,不影響開機
192.168.12.19:/data/openstack/images?/var/lib/glance/images/?nfs?defaults,_netdev?0?0
mount -a?
注意/var/lib/glance/images的權限必須是glance
8、驗證glance能否上傳
wget?http://download.cirros-cloud.net/0.4.0/cirros-0.4.0-x86_64-disk.img [root@controller1?~]#?openstack?image?create?"cirros-0.4.0"?\ ??--file?/root/cirros-0.4.0-x86_64-disk.img?\ ??--disk-format?qcow2?--container-format?bare?\ ??--public
openstack?image?list
cat? /var/log/glance/*.log??? 日志 用于排錯
placement服務
官方文檔:https://docs.openstack.org/placement/stein/install/install-rdo.html
一、數據庫
1、創建數據庫授權
mysql?-uroot?-p123456 MariaDB?[(none)]>?CREATE?DATABASE?placement; GRANT?ALL?PRIVILEGES?ON?placement.*?TO?'placement'@'%'?IDENTIFIED?BY?'placement123';
2、在控制端連接測試
mysql?-uplacement?-pplacement123?-h292.168.12.19
二、創建相應的服務并注冊api
1、創建placement用戶
source?scripts/admin-stein.sh openstack?user?create?--domain?default?--password-prompt?placement
2、將placement用戶加入admin角色組
openstack?role?add?--project?service?--user?placement?admin
3、創建placement服務
openstack service create --name placement --description "Placement API" placement
4、注冊api到服務
openstack endpoint create --region RegionOne placement public http://openstack-vip.heng.net:8778?
openstack endpoint create --region RegionOne placement internal http://openstack-vip.heng.net:8778
openstack endpoint create --region RegionOne placement admin http://openstack-vip.heng.net:8778
openstack endpoint list? 現在就有3組endpoint
三、安裝對應服務的軟件包并修改配置文件
1、 安裝包
yum?install?openstack-placement-api
2、 修改配置文件
vi /etc/placement/placement.conf
[placement_database] connection=mysql+pymysql://placement:placement123@openstack-mysql.heng.net/placement ? [api] auth_strategy?=?keystone??去掉注釋 ? [keystone_authtoken] ? auth_url?=?http://openstack-vip.heng.net:5000/v3 memcached_servers?=?openstack-mysql.heng.net:11211 auth_type?=?password project_domain_name?=?default user_domain_name?=?default project_name?=?service username?=?placement password?=?placement
3、初始化數據庫
su?-s?/bin/sh?-c?"placement-manage?db?sync"?placement
重啟httpd
source?scripts/admin-stein.sh placement-status?upgrade?check
免責聲明:本站發布的內容(圖片、視頻和文字)以原創、轉載和分享為主,文章觀點不代表本網站立場,如果涉及侵權請聯系站長郵箱:is@yisu.com進行舉報,并提供相關證據,一經查實,將立刻刪除涉嫌侵權內容。