4.openstack之mitaka搭建glance镜像服务
生活随笔
收集整理的這篇文章主要介紹了
4.openstack之mitaka搭建glance镜像服务
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
部署鏡像服務
一:安裝和配置服務
1.建庫建用戶
mysql -u root -p CREATE DATABASE glance; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '密碼'; GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '密碼'; flush privileges;2.keystone認證操作:
上面提到過:所有后續項目的部署都統一放到一個租戶service里,然后需要為每個項目建立用戶,建管理員角色,建立關聯 admin-openrc openstack user create --domain default --password-prompt glanceopenstack role add --project service --user glance admin建立服務實體 openstack service create --name glance \--description "OpenStack Image" image建端點 openstack endpoint create --region RegionOne \image public http://controller:9292openstack endpoint create --region RegionOne \image internal http://controller:9292openstack endpoint create --region RegionOne \image admin http://controller:92923.安裝軟件
yum install openstack-glance -y4.修改配置:
編輯:/etc/glance/glance-api.conf
#vim /etc/glance/glance-api.conf [database] #這里的數據庫連接配置是用來初始化生成數據庫表結構,不配置無法生成數據庫表結構 #glance-api不配置database對創建vm無影響,對使用metada有影響 #日志報錯:ERROR glance.api.v2.metadef_namespaces connection = mysql+pymysql://glance:liuyao@controller/glance[keystone_authtoken] auth_url = http://controller:5000 memcached_servers = controller:11211 auth_type = password project_domain_name = default user_domain_name = default project_name = service username = glance password = liuyao[paste_deploy] flavor = keystone[glance_store] stores = file,http default_store = file filesystem_store_datadir = /var/lib/glance/images/編輯:/etc/glance/glance-registry.conf[database] #這里的數據庫配置是用來glance-registry檢索鏡像元數據 connection = mysql+pymysql://glance:liuyao@controller/glance新建目錄: mkdir /var/lib/glance/images/ chown glance. /var/lib/glance/images/同步數據庫:(此處會報一些關于future的問題,自行忽略)
su -s /bin/sh -c "glance-manage db_sync" glance啟動服務:
systemctl enable openstack-glance-api.service \openstack-glance-registry.service systemctl start openstack-glance-api.service \openstack-glance-registry.service二:驗證操作:
source admin-openrc wget http://download.cirros-cloud.net/0.3.4/cirros-0.3.4-x86_64-disk.img openstack image create "cirros" \--file cirros-0.3.4-x86_64-disk.img \--disk-format qcow2 --container-format bare \--publicopenstack image list轉載于:https://www.cnblogs.com/liu-yao/p/5940600.html
總結
以上是生活随笔為你收集整理的4.openstack之mitaka搭建glance镜像服务的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 纪中2016.10.6比赛不明总结
- 下一篇: click事件的累加绑定