本帖最后由 pig2 于 2015-9-23 17:28 编辑
问题导读
1.keystone这里是如何配置的?
2.如何同步数据库?
3.你认为同步数据库错误,会是哪些原因?
1.配置准备
1.创建数据库完成下面内容
a.登录mysql
[mw_shl_code=bash,true] mysql -u root -p[/mw_shl_code]
b.创建glance数据库
[mw_shl_code=bash,true]CREATE DATABASE glance;[/mw_shl_code]
c.授权
[mw_shl_code=bash,true]GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' \
IDENTIFIED BY 'GLANCE_DBPASS';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' \
IDENTIFIED BY 'GLANCE_DBPASS';[/mw_shl_code]
d.退出数据库
[mw_shl_code=bash,true]exit[/mw_shl_code]
2.加载管理员环境变量
[mw_shl_code=bash,true] source admin-openrc.sh[/mw_shl_code]
3.创建服务凭据,完成下面内容
a.创建glance user
[mw_shl_code=bash,true]openstack user create --password-prompt glance[/mw_shl_code]
[mw_shl_code=bash,true]User Password:
Repeat User Password:
+----------+----------------------------------+
| Field | Value |
+----------+----------------------------------+
| email | None |
| enabled | True |
| id | 1dc206e084334db2bee88363745da014 |
| name | glance |
| username | glance |
+----------+----------------------------------+[/mw_shl_code]
b.添加admin角色到 glance 用户 和 service 租户:
[mw_shl_code=bash,true]openstack role add --project service --user glance admin[/mw_shl_code]
[mw_shl_code=bash,true]+-------+----------------------------------+
| Field | Value |
+-------+----------------------------------+
| id | cd2cb9a39e874ea69e5d4b896eb16128 |
| name | admin |
+-------+----------------------------------+[/mw_shl_code]
c.创建glance 服务实例
[mw_shl_code=bash,true]openstack service create --name glance \
--description "OpenStack Image service" image[/mw_shl_code]
[mw_shl_code=bash,true]+-------------+----------------------------------+
| Field | Value |
+-------------+----------------------------------+
| description | OpenStack Image service |
| enabled | True |
| id | 178124d6081c441b80d79972614149c6 |
| name | glance |
| type | image |
+-------------+----------------------------------+[/mw_shl_code]
4.创建glance服务api endpoint
[mw_shl_code=bash,true]openstack endpoint create \
--publicurl http://controller:9292 \
--internalurl http://controller:9292 \
--adminurl http://controller:9292 \
--region RegionOne \
image[/mw_shl_code]
[mw_shl_code=bash,true]+--------------+----------------------------------+
| Field | Value |
+--------------+----------------------------------+
| adminurl | http://controller:9292 |
| id | 805b1dbc90ab47479111102bc6423313 |
| internalurl | http://controller:9292 |
| publicurl | http://controller:9292 |
| region | RegionOne |
| service_id | 178124d6081c441b80d79972614149c6 |
| service_name | glance |
| service_type | image |
+--------------+----------------------------------+[/mw_shl_code]
2.安装配置glance组件
1.安装glance
[mw_shl_code=bash,true] yum install openstack-glance python-glance python-glanceclient[/mw_shl_code]
2.编辑文件/etc/glance/glance-api.conf,添加下面内容
a.在 [database]部分,配置数据库访问
[mw_shl_code=bash,true][database]
...
connection = mysql://glance:GLANCE_DBPASS@controller/glance[/mw_shl_code]
GLANCE_DBPASS替换为自己设置的密码
b.在 [keystone_authtoken] 和 [paste_deploy] 部分,配置keystone访问
[mw_shl_code=bash,true][keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS
[paste_deploy]
...
flavor = keystone[/mw_shl_code]
注意:注释掉其他 [keystone_authtoken]部分。
c.在 [glance_store]部分,配置本地文件系统存储和本地镜像文件:
[mw_shl_code=bash,true][glance_store]
...
default_store = file
filesystem_store_datadir = /var/lib/glance/images/[/mw_shl_code]
d.在[DEFAULT] 部分,配置 noop 通知驱动禁用通知
[mw_shl_code=bash,true][DEFAULT]
...
notification_driver = noop[/mw_shl_code]
e.启用详细信息日志记录
[mw_shl_code=bash,true][DEFAULT]
...
verbose = True[/mw_shl_code]
3.编辑文件 /etc/glance/glance-registry.conf完成下面内容
a.在 [database] 部分,配置数据库访问
[mw_shl_code=bash,true][database]
...
connection = mysql://glance:GLANCE_DBPASS@controller/glance[/mw_shl_code]
GLANCE_DBPASS 替换自己设置密码
b.在 [keystone_authtoken] 和 [paste_deploy] 部分, 配置keystone访问
[mw_shl_code=bash,true][keystone_authtoken]
...
auth_uri = http://controller:5000
auth_url = http://controller:35357
auth_plugin = password
project_domain_id = default
user_domain_id = default
project_name = service
username = glance
password = GLANCE_PASS
[paste_deploy]
...
flavor = keystone[/mw_shl_code]
c.在[DEFAULT] 部分,配置 noop 通知驱动禁用通知
[mw_shl_code=bash,true][DEFAULT]
...
notification_driver = noop[/mw_shl_code]
d.启用详细信息日志记录
[mw_shl_code=bash,true][DEFAULT]
...
verbose = True[/mw_shl_code]
4.同步数据库
[mw_shl_code=bash,true]su -s /bin/sh -c "glance-manage db_sync" glance[/mw_shl_code]
5.完成安装
启动服务
[mw_shl_code=bash,true] systemctl enable openstack-glance-api.service openstack-glance-registry.service
systemctl start openstack-glance-api.service openstack-glance-registry.service[/mw_shl_code]
相关篇章
openstack【Kilo】入门 【准备篇】一:整体介绍【centos】
http://www.aboutyun.com/thread-15205-1-1.html
openstack【Kilo】入门 【准备篇】二:检测网络互通性【centos】
http://www.aboutyun.com/thread-15206-1-1.html
openstack【Kilo】入门 【准备篇】三:NTP安装【centos】
http://www.aboutyun.com/thread-15207-1-1.html
openstack【Kilo】入门 【准备篇】四:openstack包【centos】
http://www.aboutyun.com/thread-15210-1-1.html
openstack【Kilo】入门 【准备篇】五:mysql及rabbitmq安装【centos】
http://www.aboutyun.com/thread-15213-1-1.html
openstack【Kilo】入门 【keystone篇】六:keystone安装配置【centos】
http://www.aboutyun.com/thread-15214-1-1.html
openstack【Kilo】入门 【keystone篇】七:创建服务实例和API endpoint【centos】
http://www.aboutyun.com/thread-15215-1-1.html
openstack【Kilo】入门 【keystone篇】八:创建租户, 用户, 和角色【centos】
http://www.aboutyun.com/thread-15216-1-1.html
openstack【Kilo】入门 【keystone篇】九:验证keystone安装【centos】
http://www.aboutyun.com/thread-15233-1-1.html
openstack【Kilo】入门 【keystone篇】十:创建openstack客户端脚本【centos】
http://www.aboutyun.com/thread-15234-1-1.html
openstack【Kilo】入门 【glance篇】十一:安装配置glance【centos】
http://www.aboutyun.com/thread-15242-1-1.html
openstack【Kilo】入门 【glance篇】十二:glance安装验证【centos】
http://www.aboutyun.com/thread-15243-1-1.html
openstack【Kilo】入门 【nova篇】十三:nova安装配置1:控制节点【centos】
http://www.aboutyun.com/thread-15258-1-1.html
openstack【Kilo】入门 【nova篇】十四:nova安装配置2:计算节点【centos】
http://www.aboutyun.com/thread-15259-1-1.html
openstack【Kilo】入门 【neutron篇】十五:neutron安装配置:控制节点【centos】
http://www.aboutyun.com/thread-15260-1-1.html
openstack【Kilo】入门 【neutron篇】十六:neutron安装配置:网络节点【centos】
http://www.aboutyun.com/thread-15272-1-1.html
openstack【Kilo】入门 【neutron篇】十七:neutron安装配置:计算节点【centos】
http://www.aboutyun.com/thread-15330-1-1.html
openstack【Kilo】入门 【neutron篇】十八:实例化网络【centos】
http://www.aboutyun.com/thread-15342-1-1.html
openstack【Kilo】入门 【neutron篇】十九:dasboard安装配置【centos】
http://www.aboutyun.com/thread-15352-1-1.html
openstack【Kilo】入门 【neutron篇】二十:创建实例(neutron)【centos】
http://www.aboutyun.com/thread-15356-1-1.html
|
|