【发布时间】:2011-10-28 06:06:21
【问题描述】:
我们有两台带有 Pacemaker (crm) 设置的服务器,可启用主/备用集群。目前有两个由 Pacemaker 控制/监控的服务,如果其中任何一个出现故障,将导致故障转移到备用服务器,即我们自己的自定义服务(以下称为 customservice1)和 mysql。
customservice1 和 mysql 在备用服务器上停止并在主服务器上运行(显然)。当发生故障转移时,起搏器似乎会停止两者(或者如果只有一个因某种原因失败,则确保它们停止,我不太清楚这一点),更改主服务器和备用服务器的 IP 地址(以便DNS 中的别名将始终转到主服务器),然后在之前的备用服务器上启动 customservice1 和 mysql。
我想为此添加一个步骤,由起搏器控制,只要发生故障转移,它将简单地重新启动 httpd。 httpd 目前一直在主备服务器上运行。 httpd 中的故障目前不会导致故障转移,我对添加该监控并不真正感兴趣,我只是希望起搏器在使备用服务器成为主要服务器时运行相当于“服务 httpd 重启”。
添加只会重新启动服务的新原语的正确语法是什么?
目前的起搏器配置如下:
node $id="XX" some.machine.name \
attributes standby="off"
node $id="YY" another.machine.name
primitive customservice1 lsb:customservice1 \
op monitor interval="30s" timeout="30s" \
op start interval="0" timeout="120" \
op stop interval="0" timeout="120" \
meta target-role="Started"
primitive mysql-server ocf:heartbeat:mysql \
params binary="/usr/bin/mysqld_safe" config="/etc/my.cnf" datadir="/some/data/dir" user="mysql" pid="/var/lib/mysql/mysql.pid" socket="/var/lib/mysql/mysql.sock" \
op monitor interval="30s" timeout="30s" \
op start interval="0" timeout="120" \
op stop interval="0" timeout="120"
primitive node1-stonith stonith:external/riloe \
params hostlist="some.machine.name" ilo_user="Administrator" ilo_hostname="some-ilo.machine.name" ilo_password="<ilopassword>" ilo_can_reset="1" ilo_protocol="2.0" ilo_powerdown_method="button" \
op monitor interval="120s" timeout="40s" \
meta target-role="Started"
primitive node2-stonith stonith:external/riloe \
params hostlist="another.machine.name" ilo_user="Administrator" ilo_hostname="another-ilo.machine.name" ilo_password="<ilopassword>" ilo_can_reset="1" ilo_protocol="2.0" ilo_powerdown_method="button" \
op monitor interval="120s" timeout="40s" \
meta target-role="Started"
primitive node_one_ip ocf:heartbeat:IPaddr2 \
params ip="1.1.1.1" cidr_netmask="255.255.255.0" nic="eth0" \
op monitor interval="40s" timeout="20s"
primitive node_two_ip ocf:heartbeat:IPaddr2 \
params ip="1.1.1.2" cidr_netmask="255.255.255.0" nic="eth0" \
op monitor interval="40s" timeout="20s" \
meta target-role="Started"
group only-group node_one_ip mysql-server customservice1
property $id="cib-bootstrap-options" \
dc-version="1.0.9-89bd754939df5150de7cd76835f98fe90851b677" \
cluster-infrastructure="Heartbeat" \
no-quorum-policy="ignore" \
last-lrm-refresh="1287686604" \
default-resource-stickiness="1"
【问题讨论】:
标签: linux cluster-computing apache high-availability failover