《3》CentOS7.0+OpenStack+kvm云平台部署—配置Glance
感謝朋友支持本博客,歡迎共同探討交流。因?yàn)槟芰蜁r(shí)間有限,錯(cuò)誤之處在所難免,歡迎指正。
假設(shè)轉(zhuǎn)載。請保留作者信息。
博客地址:http://blog.csdn.net/qq_21398167
原博文地址:http://blog.csdn.net/qq_21398167/article/details/46385621
初始化Glance
(1).安裝Glance服務(wù):
[root@openstack ~]# yum -y installopenstack-glance
?
(2).創(chuàng)建Glance數(shù)據(jù)庫:
[root@openstack ~]#?openstack-db--init --service glance
?
(3).改動(dòng)配置文件里的數(shù)據(jù)庫鏈接:
[root@openstack ~]#?openstack-config--set /etc/glance/glance-api.conf DEFAULT sql_connectionmysql://glance:glance@localhost/glance
[root@openstack ~]#?openstack-config--set /etc/glance/glance-registry.conf DEFAULT sql_connectionmysql://glance:glance@localhost/glance
?
創(chuàng)建User,定義Services和 API Endpoints
(1).為Glance服務(wù)創(chuàng)建一個(gè)glance用戶:
[root@openstack ~]#?keystoneuser-create--name=glance --pass=service--email=glance@zcs.com
[root@openstack ~]#?keystoneuser-role-add --user=glance --tenant=service --role=admin
(2).為glance創(chuàng)建一個(gè)服務(wù):
[root@openstack ~]#?keystoneservice-create --name=glance --type=image --description="GlanceImageService"
(3).使用服務(wù)ID創(chuàng)建一個(gè)endpoint:
[root@openstack ~]#?vi/root/config/glance.sh
#!/bin/bash
my_ip=10.1.1.2
service=$(keystone service-list | awk'/glance/ {print $2}')
keystone endpoint-create --service-id=$service--publicurl=http://$my_ip:9292 --internalurl=http://$my_ip:9292--adminurl=http://$my_ip:9292
?
[root@mg ~]# sh /root/config/glance.sh
WARNING: Bypassing authentication using atoken & endpoint (authentication credentials are being ignored).
+-------------+----------------------------------+
|??Property? |????????????? Value?????????????? |
+-------------+----------------------------------+
|??adminurl? |???? http://10.1.1.2:9292????? |
|?????id???? |fe281515d406407bbcd4887cb5815de4 |
| internalurl |???? http://10.1.1.2:9292????? |
|?publicurl? |???? http://10.1.1.2:9292????? |
|???region?? |??????????? regionOne???????????? |
|?service_id | 7c0102f0e715479e9292c0581d214de2 |
+-------------+----------------------------------+
配置Glance服務(wù)
?
(1).將keystone認(rèn)證信息加入到glance配置文件里:
[root@openstack ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken auth_host 127.0.0.1
[root@openstack ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken auth_port 35357
[root@openstack ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken auth_protocol http
[root@openstack ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken admin_tenant_name service
[root@openstack ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken admin_user glance
[root@openstack ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken admin_password service
?
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken auth_host 127.0.0.1
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken auth_port 35357
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken auth_protocol http
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name service
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken admin_user glance
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken admin_password service
(2).改動(dòng)ini文件路徑。將keystone認(rèn)證信息加入到ini文件里:
[root@openstack ~]# openstack-config --set/etc/glance/glance-api.conf paste_deploy config_file/etc/glance/glance-api-paste.ini
[root@openstack ~]# openstack-config --set/etc/glance/glance-api.conf paste_deploy flavor keystone
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry.conf paste_deploy config_file /etc/glance/glance-registry-paste.ini
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry.conf paste_deploy flavor keystone
?
[root@openstack ~]# cp/usr/share/glance/glance-api-dist-paste.ini /etc/glance/glance-api-paste.ini
[root@openstack ~]# cp/usr/share/glance/glance-registry-dist-paste.ini/etc/glance/glance-registry-paste.ini
[root@openstack ~]# chown -R root:glance/etc/glance/glance-api-paste.ini?
[root@openstack ~]# chown -R root:glance/etc/glance/glance-registry-paste.ini
?
[root@openstack ~]# openstack-config --set/etc/glance/glance-api-paste.ini filter:authtoken auth_host 127.0.0.1
[root@openstack ~]# openstack-config --set/etc/glance/glance-api-paste.ini filter:authtoken admin_tenant_name service
[root@openstack ~]# openstack-config --set/etc/glance/glance-api-paste.ini filter:authtoken admin_user glance
[root@openstack ~]# openstack-config --set/etc/glance/glance-api-paste.ini filter:authtoken admin_password service
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry-paste.ini filter:authtoken auth_host 127.0.0.1
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry-paste.ini filter:authtoken admin_tenant_nameservice
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry-paste.ini filter:authtoken admin_user glance
[root@openstack ~]# openstack-config --set/etc/glance/glance-registry-paste.ini filter:authtoken admin_password service
轉(zhuǎn)載于:https://www.cnblogs.com/zsychanpin/p/6791971.html
總結(jié)
以上是生活随笔為你收集整理的《3》CentOS7.0+OpenStack+kvm云平台部署—配置Glance的全部內(nèi)容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: stl_alloc.h分配器
- 下一篇: C# 密封类sealed