openstack controller ha测试环境搭建记录(七)——配置glance
在所有集群安装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的更多相关文章
- openstack controller ha测试环境搭建记录(一)——操作系统准备
为了初步了解openstack controller ha的工作原理,搭建测试环境进行学习. 在学习该方面知识时,当前采用的操作系统版本是centos 7.1 x64.首先在ESXi中建立2台用于测试 ...
- openstack controller ha测试环境搭建记录(二)——配置corosync和pacemaker
corosync.conf请备份再编辑:# vi /etc/corosync/corosync.conf totem { version: 2 token: 10000 t ...
- openstack controller ha测试环境搭建记录(十五)——创建实例
# source demo-openrc.sh # ssh-keygenGenerating public/private rsa key pair.Enter file in which to sa ...
- openstack controller ha测试环境搭建记录(十三)——配置cinder(控制节点)
在任一控制节点创建用户:mysql -u root -pCREATE DATABASE cinder;GRANT ALL PRIVILEGES ON cinder.* TO 'cinder'@'loc ...
- openstack controller ha测试环境搭建记录(六)——配置keystone
在所有节点的hosts文件添加:10.0.0.10 myvip 在所有节点安装# yum install -y openstack-keystone python-keystoneclient# yu ...
- openstack controller ha测试环境搭建记录(五)——配置rabbitmq集群
配置rabbitmq集群的步骤非常简单,因为其本身含集群功能,参考openstack官网文档:http://docs.openstack.org/ha-guide/controller-ha-rabb ...
- openstack controller ha测试环境搭建记录(三)——配置haproxy
haproxy.cfg请备份再编辑:# vi /etc/haproxy/haproxy.cfg global chroot /var/lib/haproxy daemon group ...
- openstack controller ha测试环境搭建记录(十)——配置neutron(控制节点)
创建neutron用户:mysql -u root -p CREATE DATABASE neutron;GRANT ALL PRIVILEGES ON neutron.* TO 'neutron'@ ...
- openstack controller ha测试环境搭建记录(八)——配置nova(控制节点)
在任一节点创建nova用户:mysql -u root -p CREATE DATABASE nova;GRANT ALL PRIVILEGES ON nova.* TO 'nova'@'localh ...
随机推荐
- Hibernate Tools
(声明)本文转自:http://linjia880714.iteye.com/blog/859334 hibernate-tools详细使用教程 使用hibernate-tool的版本是hiberna ...
- 笨方法学python--安装和准备
1 下载并安装python http://python.org/download 下载python2.7. python2.7并不是python3.5的旧版本. python2现在应用较广,网上资料较 ...
- parted
1.选择分区表 sudo parted -s /dev/sdXX mklabel gpt 2.创建分区 sudo parted -s -- /dev/sdX mkpart primary 0 -1s ...
- String.valueOf(int i)和Integer.toString(int i)有什么区别?
以下是2个人的回答,我是从百度上复制下来的,做个笔记,以后方便看 String.valueOf()它可以将JAVA基本类型(int,double,boolean等)和对象(Object)转换成Stri ...
- listener.ora
EOF YESTERDAY=`cat /database/log/tns_log/yesterday.out` TODAY=`date '+%d-%b-%Y'` echo $YESTERDAY $T ...
- [DP]一道理想收入问题【转】
题意:以一元为本金,能获得的最大收入,第i天股票价格为v[i],1<=i<=m 思路: (1)DP思路明显,直接进行动态规划,令f[i]代表第i天所获得的最大收入.那么有公式: f[i] ...
- boost库之geometry
环境:win732位旗舰版.VS2010旗舰版.boost 1.55.0版本.坐标系为MM_TEXT Geometry是一个开源的几何计算库,包含了几何图形最基本的操作(也支持复杂的操作),下面我们看 ...
- linux的学习系列 9--网络通信
ping 命令 ping 命令会向网络上的主机发送应答请求,根据响应信息可以判断远程主机是否可用. ping 命令的语法: $ping hostname or ip-address 如果网络畅通,很快 ...
- Learning Java 8 Syntax (Java in a Nutshell 6th)
Java is using Unicode set Java is case sensitive Comments, C/C++ style abstract, const, final, int, ...
- Factory and AbstractFactory ——抽象与具体的分离
Factory and AbstractFactory——抽象与具体的分离 面向对象标准关注于抽取一系列事物的共同行为,组建一个基类.行为再划分成两类: 1:现在及以后不太可能会变化的行为. 2:以后 ...