在所有集群安装glance软件:
yum install -y openstack-glance python-glanceclient

在任一节点创建glance用户:
mysql -u root -p
CREATE DATABASE glance;
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'localhost' IDENTIFIED BY '123456';
GRANT ALL PRIVILEGES ON glance.* TO 'glance'@'%' IDENTIFIED BY '123456';
quit

在任一节点设置环境变量:
source admin-openrc.sh

在任一节点创建keystone中的相关用户、服务、endpoint等:
keystone user-create --name=glance --pass=123456
keystone user-role-add --user=glance --tenant=service --role=admin
keystone service-create --name=glance --type=image --description="OpenStack Image Service"
keystone endpoint-create \
--service-id=$(keystone service-list | awk '/ image / {print $2}') \
--publicurl=http://myvip:9292 \
--internalurl=http://myvip:9292 \
--adminurl=http://myvip:9292

在所有节点修改配置文件:
openstack-config --set /etc/glance/glance-api.conf database connection mysql://glance:123456@myvip/glance
openstack-config --set /etc/glance/glance-registry.conf database connection mysql://glance:123456@myvip/glance

openstack-config --set /etc/glance/glance-api.conf keystone_authtoken auth_uri http://myvip:5000/v2.0
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken identity_uri http://myvip:35357
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_user glance
openstack-config --set /etc/glance/glance-api.conf keystone_authtoken admin_password 123456
openstack-config --set /etc/glance/glance-api.conf paste_deploy flavor keystone
openstack-config --set /etc/glance/glance-api.conf DEFAULT notification_driver noop
openstack-config --set /etc/glance/glance-api.conf glance_store default_store file
openstack-config --set /etc/glance/glance-api.conf glance_store filesystem_store_datadir /var/lib/glance/images/
openstack-config --set /etc/glance/glance-api.conf DEFAULT verbose True

openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken auth_uri http://myvip:5000/v2.0
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken identity_uri http://myvip:35357
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_tenant_name service
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_user glance
openstack-config --set /etc/glance/glance-registry.conf keystone_authtoken admin_password 123456
openstack-config --set /etc/glance/glance-registry.conf paste_deploy flavor keystone
openstack-config --set /etc/glance/glance-registry.conf DEFAULT notification_driver noop
openstack-config --set /etc/glance/glance-registry.conf DEFAULT verbose True

openstack-config --set /etc/glance/glance-api.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/glance/glance-api.conf DEFAULT rabbit_password 123456
openstack-config --set /etc/glance/glance-api.conf DEFAULT rabbit_hosts controller1:5672,controller2:5672,controller3:5672
openstack-config --set /etc/glance/glance-api.conf DEFAULT rabbit_retry_interval 1
openstack-config --set /etc/glance/glance-api.conf DEFAULT rabbit_retry_backoff 2
openstack-config --set /etc/glance/glance-api.conf DEFAULT rabbit_max_retries 0
openstack-config --set /etc/glance/glance-api.conf DEFAULT rabbit_durable_queues true
openstack-config --set /etc/glance/glance-api.conf DEFAULT rabbit_ha_queues true

openstack-config --set /etc/glance/glance-registry.conf DEFAULT rpc_backend rabbit
openstack-config --set /etc/glance/glance-registry.conf DEFAULT rabbit_password 123456
openstack-config --set /etc/glance/glance-registry.conf DEFAULT rabbit_hosts controller1:5672,controller2:5672,controller2:5673
openstack-config --set /etc/glance/glance-registry.conf DEFAULT rabbit_retry_interval 1
openstack-config --set /etc/glance/glance-registry.conf DEFAULT rabbit_retry_backoff 2
openstack-config --set /etc/glance/glance-registry.conf DEFAULT rabbit_max_retries 0
openstack-config --set /etc/glance/glance-registry.conf DEFAULT rabbit_durable_queues true
openstack-config --set /etc/glance/glance-registry.conf DEFAULT rabbit_ha_queues true

疑问:/etc/glance/glance-api.conf中的filesystem_store_datadirs指向的是本地路径,是否有官方的说法来消除此问题。

在任一节点初始化glance数据库:
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

---------------------------------------------------------------------------------
由于在初始化glance数据库时,有问题,该问题是由未配置完.conf文件就执行初始化数据库的动作造成:
# su -s /bin/sh -c "glance-manage db_sync" glance
# echo $?
1

在网络上查找另外一种初始化数据库的方法:
# openstack-db --init --service glance --password 123456 --rootpw 123456

注:该命令会自动在glance-api.conf和glance-registry.conf添加“connection=”,一般需要手动删除。
或:
mysql -u glance -p -e 'drop database glance;'
mysql -u glance -p -e 'create database glance;'
su -s /bin/sh -c "glance-manage db sync" glance

在配置时,尝试在glance-api.conf和glance-registry.conf中设置bind_host,出现HTTPInternalServerError (HTTP 500)错误。取消该配置项才解决问题:
http://www.gossamer-threads.com/lists/openstack/operators/26429

openstack controller ha测试环境搭建记录(七)——配置glance的更多相关文章

  1. openstack controller ha测试环境搭建记录(一)——操作系统准备

    为了初步了解openstack controller ha的工作原理,搭建测试环境进行学习. 在学习该方面知识时,当前采用的操作系统版本是centos 7.1 x64.首先在ESXi中建立2台用于测试 ...

  2. openstack controller ha测试环境搭建记录(二)——配置corosync和pacemaker

    corosync.conf请备份再编辑:# vi /etc/corosync/corosync.conf totem {        version: 2 token: 10000        t ...

  3. openstack controller ha测试环境搭建记录(十五)——创建实例

    # source demo-openrc.sh # ssh-keygenGenerating public/private rsa key pair.Enter file in which to sa ...

  4. openstack controller ha测试环境搭建记录(十三)——配置cinder(控制节点)

    在任一控制节点创建用户:mysql -u root -pCREATE DATABASE cinder;GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'loc ...

  5. openstack controller ha测试环境搭建记录(六)——配置keystone

    在所有节点的hosts文件添加:10.0.0.10 myvip 在所有节点安装# yum install -y openstack-keystone python-keystoneclient# yu ...

  6. openstack controller ha测试环境搭建记录(五)——配置rabbitmq集群

    配置rabbitmq集群的步骤非常简单,因为其本身含集群功能,参考openstack官网文档:http://docs.openstack.org/ha-guide/controller-ha-rabb ...

  7. openstack controller ha测试环境搭建记录(三)——配置haproxy

    haproxy.cfg请备份再编辑:# vi /etc/haproxy/haproxy.cfg global    chroot /var/lib/haproxy    daemon    group ...

  8. openstack controller ha测试环境搭建记录(十)——配置neutron(控制节点)

    创建neutron用户:mysql -u root -p CREATE DATABASE neutron;GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@ ...

  9. openstack controller ha测试环境搭建记录(八)——配置nova(控制节点)

    在任一节点创建nova用户:mysql -u root -p CREATE DATABASE nova;GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localh ...

随机推荐

  1. zk reconnect

    http://blog.csdn.net/hengyunabc/article/details/41450003 http://blog.csdn.net/hengyunabc/article/det ...

  2. fp oo

    http://blog.enfranchisedmind.com/2009/05/scala-not-functional/

  3. Objective-C语法之NSMutableString字符串的那些事儿

     Objective-C语法之字符串那些事         NSMutableString 类 继承NSString类,那么NSString 提供的方法在NSMutableString中基本都可以使用 ...

  4. 在写一个iOS应用之前必须做的7件事

    转载自:http://www.cocoachina.com/ios/20160316/15685.html 原文:https://medium.com/ios-os-x-development/7-t ...

  5. Chapter 1 First Sight——14

    I parked in front of the first building, which had a small sign over the door reading front office. ...

  6. java设计原则:16种原则

    一   类的设计原则   1 依赖倒置原则-Dependency Inversion Principle (DIP) 2 里氏替换原则-Liskov Substitution Principle (L ...

  7. hdu_5110_Alexandra and COS(DP+分块思想)

    题目连接:hdu_5110_Alexandra and COS 题意: 给你一个图,X代表宝藏,然后有一个船,它的声纳的频率为D,定船到宝藏的距离为Dis=max(abs(x1-x2),abs(y1- ...

  8. [code]字母重排

    1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 3 ...

  9. GPRS管理与创建APN拨号连接(转)

    源:http://www.cnblogs.com/michael-zhangyu/archive/2009/07/04/1516797.html 本文主要介绍一些GPRS管理与创建APN拨号连接相关的 ...

  10. 自己用wireshark 抓了个包,分析了一下

    我自把对应 ip 包的头部拿出来手动分析了一下 :)