《3》CentOS7.0+OpenStack+kvm云平台部署—配置Glance
Posted zsychanpin
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了《3》CentOS7.0+OpenStack+kvm云平台部署—配置Glance相关的知识,希望对你有一定的参考价值。
感谢朋友支持本博客,欢迎共同探讨交流。因为能力和时间有限,错误之处在所难免,欢迎指正。
假设转载。请保留作者信息。
博客地址:http://blog.csdn.net/qq_21398167
原博文地址:http://blog.csdn.net/qq_21398167/article/details/46385621
初始化Glance
(1).安装Glance服务:
[[email protected] ~]# yum -y installopenstack-glance
(2).创建Glance数据库:
[[email protected] ~]# openstack-db--init --service glance
(3).改动配置文件里的数据库链接:
[[email protected] ~]# openstack-config--set /etc/glance/glance-api.conf DEFAULT sql_connectionmysql://glance:[email protected]/glance
[[email protected] ~]# openstack-config--set /etc/glance/glance-registry.conf DEFAULT sql_connectionmysql://glance:[email protected]/glance
创建User,定义Services和 API Endpoints
(1).为Glance服务创建一个glance用户:
[[email protected] ~]# keystoneuser-create--name=glance --pass=service[email protected]
[[email protected] ~]# keystoneuser-role-add --user=glance --tenant=service --role=admin
(2).为glance创建一个服务:
[[email protected] ~]# keystoneservice-create --name=glance --type=image --description="GlanceImageService"
(3).使用服务ID创建一个endpoint:
[[email protected] ~]# 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
[[email protected] ~]# 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服务
(1).将keystone认证信息加入到glance配置文件里:
[[email protected] ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken auth_host 127.0.0.1
[[email protected] ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken auth_port 35357
[[email protected] ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken auth_protocol http
[[email protected] ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken admin_tenant_name service
[[email protected] ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken admin_user glance
[[email protected] ~]# openstack-config --set/etc/glance/glance-api.conf keystone_authtoken admin_password service
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken auth_host 127.0.0.1
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken auth_port 35357
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken auth_protocol http
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name service
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken admin_user glance
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry.conf keystone_authtoken admin_password service
(2).改动ini文件路径。将keystone认证信息加入到ini文件里:
[[email protected] ~]# openstack-config --set/etc/glance/glance-api.conf paste_deploy config_file/etc/glance/glance-api-paste.ini
[[email protected] ~]# openstack-config --set/etc/glance/glance-api.conf paste_deploy flavor keystone
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry.conf paste_deploy config_file /etc/glance/glance-registry-paste.ini
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry.conf paste_deploy flavor keystone
[[email protected] ~]# cp/usr/share/glance/glance-api-dist-paste.ini /etc/glance/glance-api-paste.ini
[[email protected] ~]# cp/usr/share/glance/glance-registry-dist-paste.ini/etc/glance/glance-registry-paste.ini
[[email protected] ~]# chown -R root:glance/etc/glance/glance-api-paste.ini
[[email protected] ~]# chown -R root:glance/etc/glance/glance-registry-paste.ini
[[email protected] ~]# openstack-config --set/etc/glance/glance-api-paste.ini filter:authtoken auth_host 127.0.0.1
[[email protected] ~]# openstack-config --set/etc/glance/glance-api-paste.ini filter:authtoken admin_tenant_name service
[[email protected] ~]# openstack-config --set/etc/glance/glance-api-paste.ini filter:authtoken admin_user glance
[[email protected] ~]# openstack-config --set/etc/glance/glance-api-paste.ini filter:authtoken admin_password service
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry-paste.ini filter:authtoken auth_host 127.0.0.1
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry-paste.ini filter:authtoken admin_tenant_nameservice
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry-paste.ini filter:authtoken admin_user glance
[[email protected] ~]# openstack-config --set/etc/glance/glance-registry-paste.ini filter:authtoken admin_password service
以上是关于《3》CentOS7.0+OpenStack+kvm云平台部署—配置Glance的主要内容,如果未能解决你的问题,请参考以下文章
GB/T 3906-2020 3.6 kV~40.5 kV交流金属封闭开关设备和控制设备