建立HA Openstack云 (四):安装Keystone
DOIT云计算 12年08月28日 10:28 【编译】 译者:Jim 责任编辑:唐蓉
本文为《建立HA Openstack云》第四篇。第一篇:《建立高可用OpenStack云(一):安装集群》,第二篇《建立高可用OpenStack云(二):安装Mysql》,第三篇:《建立HA Openstack云(三):安装RabbitMQ》。
现在准备工作已经完成了,该来安装Keystone,并使它高度可用,在本教程里我不会涉及安装的部分,因为手册里已经全都包括了。
只有两处不同:
·你必须在两个主机上都安装keystone,不是一个
·要将MySQL主机设置为“clustermysql”,这样它在MySQL主机之上。
·当你定义为每个服务创建虚拟IP的服务时(这里是指keystoneip, glanceip, novacomputeip等,并在建立终端时指向它们)
现在你已经安装好Keystone并创建了用户,角色,服务和终端,我们来让它“高度可用”,我们需要在启动时禁用自动载入,在两台主机上这样做:
echo "manual" > /etc/init/keystone.override
现在下载资源代理:
mkdir /usr/lib/ocf/resource.d/openstack
cd /usr/lib/ocf/resource.d/openstack/
wget https://raw.github.com/madkiss/keystone/master/tools/ocf/keystone
chmod u+x *
然后为Keystone创建基元:
crm configure primitive keystoneService ocf:openstack:keystone \
params config="/etc/keystone/keystone.conf" os_auth_url="http://clusterkeystone:5000/v2.0/" os_password="admin" os_tenant_name="admin" os_username="admin" user="keystone" client_binary="/usr/bin/keystone" \
op monitor interval="15s" timeout="30s"
“clusterkeystone”处是分配给Keystone的虚拟IP,os_*是你在安装Keystone设置的管理员用户的认证信息。
对虚拟IP和服务分组是很有用的,这样它们就能在同一主机开启:
crm configure group Keystone keystoneIP keystoneService
在MySQL主机开启后运行Keystone,可以这样做:
crm configure order keystone_after_mysqlmasterIP inf: mysqlmasterIP:start Keystone
这样你就有了一个能用的keystone故障恢复,以防主机故障。
一个例子,两个主机都在运行:
============
Last updated: Mon Jul 30 15:03:40 2012
Last change: Mon Jul 30 15:03:38 2012 via cibadmin on server2
Stack: openais
Current DC: server1 - partition with quorum
Version: 1.1.6-9971ebba4494012a93c03b40a2c58ec0eb60f50c
2 Nodes configured, 2 expected votes
5 Resources configured.
============
Online: [ server1 server2 ]
mysqlmasterIP (ocf::heartbeat:IPaddr2): Started server1
Master/Slave Set: ms_MySQL [clustermysql]
Masters: [ server1 ]
Slaves: [ server2 ]
Resource Group: Keystone
keystoneIP (ocf::heartbeat:IPaddr2): Started server2
keystoneService (ocf::openstack:keystone): Started server2
现在停止server1,几秒后你会得到:
============
Last updated: Mon Jul 30 15:08:34 2012
Last change: Mon Jul 30 15:08:26 2012 via crm_attribute on server2
Stack: openais
Current DC: server2 - partition WITHOUT quorum
Version: 1.1.6-9971ebba4494012a93c03b40a2c58ec0eb60f50c
2 Nodes configured, 2 expected votes
5 Resources configured.
============
Online: [ server2 ]
OFFLINE: [ server1 ]
mysqlmasterIP (ocf::heartbeat:IPaddr2): Started server2
Master/Slave Set: ms_MySQL [clustermysql]
Masters: [ server2 ]
Stopped: [ clustermysql:0 ]
Resource Group: Keystone keystoneIP (ocf::heartbeat:IPaddr2): Started server2
keystoneService (ocf::openstack:keystone): Started server2