関係者å„ä½
ãŠä¸–話ã«ãªã£ã¦ãŠã‚Šã¾ã™ã€‚nakaã¨ç”³ã—ã¾ã™ã€‚
環境:
2ノード構æˆ(pacemaker+heartbeat) ※nodeA,nodeBã¨ã—ã¾ã™ã€‚
OS:CentOS6.2(x86_64)
pacemaker-1.0.12-1.el6.x86_64
heartbeat-3.0.5-1.1.el6.x86_64
nodeAã§å…¨ã¦ã®ã‚°ãƒ«ãƒ¼ãƒ—リソースを起動ã•ã›ãŸçŠ¶æ…‹ã§ã€
nodeBã§ã®éšœå®³æ™‚動作を確èªã—ã¦ãŠã‚Šã¾ã™ã€‚
/etc/init.d/heartbeat stop
/etc/init.d/heartbeat start
nodeBã§heartbeatデーモンを上記コマンドã§stop/startã•ã›ãŸã¨ã“ã‚ã€
startを実行後ã«ãªãœã‹nodeAå´ã§å‹•ã„ã¦ã„ã‚‹[lsb:initスクリプトå]ã®
RAãŒåœæ¢ã—ã¦ã—ã¾ã„ã€ãã®å¾Œã™ãã«RAã¯startã—ã¾ã—ãŸã€‚
想定動作ã¨ã—ã¦ã¯ã€stopã›ãšã«ãã®ã¾ã¾èµ·å‹•ã•ã›ã¦ãŠããŸã„ã®ã§ã™ãŒã€
上記動作ã®åŽŸå› ã¨ã€ã©ã®ã‚ˆã†ã«è¨å®šã—ãŸã‚‰ã‚ˆã„ã‹ã‚’ã”æ•™æŽˆé ‚ã‘ã¾ã›ã‚“ã§ã—ょã†ã‹ï¼Ÿ
å‚考ã¾ã§ã«heartbeatデーモンをstop/startã•ã›ãŸæ™‚ã®ã‚·ã‚¹ãƒã‚°ã‚’添付ã—ã¦ãŠãã¾ã™ã€‚
以下ã€crmã®è¨å®šå†…容ã¨ãªã‚Šã¾ã™ã€‚
$ sudo crm configure show
node $id="1fc381d6-d6ad-a50f-9aab-cd8ace90fa70" nodeA
node $id="4a851515-443f-6140-b38f-dfb4bb46c010" nodeB
primitive ip_sfdb01v ocf:heartbeat:IPaddr2 \
meta migration-threshold="5" \
params ip="10.2.28.62" cidr_netmask="24" nic="eth0" iflabel="0" \
op monitor interval="3s"
primitive res_ping ocf:pacemaker:ping \
params name="eth0_ping_set" host_list="10.2.28.1" multiplier="200"
dampen="1" debug="true" attempts="10" \
op monitor interval="10s" timeout="60" \
op start interval="0" timeout="60"
primitive service_naka01v lsb:pkg_naka01v \
op start interval="0s" timeout="90s" \
op monitor interval="300s" timeout="20s" \
op stop interval="0s" timeout="100s" \
meta is-managed="true"
primitive service_sfdb01v lsb:pkg_sfdb01v \
op start interval="0s" timeout="90s" \
op monitor interval="300s" timeout="20s" \
op stop interval="0s" timeout="100s" \
meta is-managed="true"
primitive vgsfdb01v ocf:heartbeat:LVM \
params volgrpname="vgsfdb01v"
primitive vgsfdb01v_LogVol00 ocf:heartbeat:Filesystem \
meta migration-threshold="5" \
params device="/dev/vgsfdb01v/LogVol00" fstype="ext4"
directory="/mysf" \
op monitor interval="20s"
primitive vgsfdb01v_lv_quorum ocf:heartbeat:sfex \
params index="1" device="/dev/vgsfdb01v/lv_quorum"
group pkg_naka01v service_naka01v \
meta is-managed="true" target-role="Started"
group pkg_sfdb01v ip_sfdb01v vgsfdb01v vgsfdb01v_lv_quorum
vgsfdb01v_LogVol00 service_sfdb01v \
meta is-managed="true" target-role="Started"
clone clone_ping res_ping \
meta target-role="Started"
location pkg_naka01v-location pkg_naka01v \
rule $id="pkg_naka01v-location-0" 200: #uname eq nodeA \
rule $id="pkg_naka01v-location-1" 100: #uname eq nodeB
location pkg_naka01v-service-location pkg_naka01v \
rule $id="pkg_naka01v-service-location-rule" -inf: defined
eth0_ping_set and eth0_ping_set lt 200
location pkg_sfdb01v-location pkg_sfdb01v \
rule $id="pkg_sfdb01v-location-0" 200: #uname eq nodeA \
rule $id="pkg_sfdb01v-location-1" 100: #uname eq nodeB
location pkg_sfdb01v-service-location pkg_sfdb01v \
rule $id="pkg_sfdb01v-service-location-rule" -inf: defined
eth0_ping_set and eth0_ping_set lt 200
property $id="cib-bootstrap-options" \
dc-version="1.0.12-066152e" \
cluster-infrastructure="Heartbeat" \
stonith-enabled="false" \
no-quorum-policy="ignore" \
default-action-timeout="120s" \
last-lrm-refresh="1441681923"
rsc_defaults $id="rsc-options" \
resource-stickiness="INFINITY"
ãŠæ‰‹æ•°ãŠã‹ã‘致ã—ã¾ã™ãŒã€ä½•å’宜ã—ããŠé¡˜ã„致ã—ã¾ã™ã€‚
以上
--
Naka
ãŠä¸–話ã«ãªã£ã¦ãŠã‚Šã¾ã™ã€‚nakaã¨ç”³ã—ã¾ã™ã€‚
環境:
2ノード構æˆ(pacemaker+heartbeat) ※nodeA,nodeBã¨ã—ã¾ã™ã€‚
OS:CentOS6.2(x86_64)
pacemaker-1.0.12-1.el6.x86_64
heartbeat-3.0.5-1.1.el6.x86_64
nodeAã§å…¨ã¦ã®ã‚°ãƒ«ãƒ¼ãƒ—リソースを起動ã•ã›ãŸçŠ¶æ…‹ã§ã€
nodeBã§ã®éšœå®³æ™‚動作を確èªã—ã¦ãŠã‚Šã¾ã™ã€‚
/etc/init.d/heartbeat stop
/etc/init.d/heartbeat start
nodeBã§heartbeatデーモンを上記コマンドã§stop/startã•ã›ãŸã¨ã“ã‚ã€
startを実行後ã«ãªãœã‹nodeAå´ã§å‹•ã„ã¦ã„ã‚‹[lsb:initスクリプトå]ã®
RAãŒåœæ¢ã—ã¦ã—ã¾ã„ã€ãã®å¾Œã™ãã«RAã¯startã—ã¾ã—ãŸã€‚
想定動作ã¨ã—ã¦ã¯ã€stopã›ãšã«ãã®ã¾ã¾èµ·å‹•ã•ã›ã¦ãŠããŸã„ã®ã§ã™ãŒã€
上記動作ã®åŽŸå› ã¨ã€ã©ã®ã‚ˆã†ã«è¨å®šã—ãŸã‚‰ã‚ˆã„ã‹ã‚’ã”æ•™æŽˆé ‚ã‘ã¾ã›ã‚“ã§ã—ょã†ã‹ï¼Ÿ
å‚考ã¾ã§ã«heartbeatデーモンをstop/startã•ã›ãŸæ™‚ã®ã‚·ã‚¹ãƒã‚°ã‚’添付ã—ã¦ãŠãã¾ã™ã€‚
以下ã€crmã®è¨å®šå†…容ã¨ãªã‚Šã¾ã™ã€‚
$ sudo crm configure show
node $id="1fc381d6-d6ad-a50f-9aab-cd8ace90fa70" nodeA
node $id="4a851515-443f-6140-b38f-dfb4bb46c010" nodeB
primitive ip_sfdb01v ocf:heartbeat:IPaddr2 \
meta migration-threshold="5" \
params ip="10.2.28.62" cidr_netmask="24" nic="eth0" iflabel="0" \
op monitor interval="3s"
primitive res_ping ocf:pacemaker:ping \
params name="eth0_ping_set" host_list="10.2.28.1" multiplier="200"
dampen="1" debug="true" attempts="10" \
op monitor interval="10s" timeout="60" \
op start interval="0" timeout="60"
primitive service_naka01v lsb:pkg_naka01v \
op start interval="0s" timeout="90s" \
op monitor interval="300s" timeout="20s" \
op stop interval="0s" timeout="100s" \
meta is-managed="true"
primitive service_sfdb01v lsb:pkg_sfdb01v \
op start interval="0s" timeout="90s" \
op monitor interval="300s" timeout="20s" \
op stop interval="0s" timeout="100s" \
meta is-managed="true"
primitive vgsfdb01v ocf:heartbeat:LVM \
params volgrpname="vgsfdb01v"
primitive vgsfdb01v_LogVol00 ocf:heartbeat:Filesystem \
meta migration-threshold="5" \
params device="/dev/vgsfdb01v/LogVol00" fstype="ext4"
directory="/mysf" \
op monitor interval="20s"
primitive vgsfdb01v_lv_quorum ocf:heartbeat:sfex \
params index="1" device="/dev/vgsfdb01v/lv_quorum"
group pkg_naka01v service_naka01v \
meta is-managed="true" target-role="Started"
group pkg_sfdb01v ip_sfdb01v vgsfdb01v vgsfdb01v_lv_quorum
vgsfdb01v_LogVol00 service_sfdb01v \
meta is-managed="true" target-role="Started"
clone clone_ping res_ping \
meta target-role="Started"
location pkg_naka01v-location pkg_naka01v \
rule $id="pkg_naka01v-location-0" 200: #uname eq nodeA \
rule $id="pkg_naka01v-location-1" 100: #uname eq nodeB
location pkg_naka01v-service-location pkg_naka01v \
rule $id="pkg_naka01v-service-location-rule" -inf: defined
eth0_ping_set and eth0_ping_set lt 200
location pkg_sfdb01v-location pkg_sfdb01v \
rule $id="pkg_sfdb01v-location-0" 200: #uname eq nodeA \
rule $id="pkg_sfdb01v-location-1" 100: #uname eq nodeB
location pkg_sfdb01v-service-location pkg_sfdb01v \
rule $id="pkg_sfdb01v-service-location-rule" -inf: defined
eth0_ping_set and eth0_ping_set lt 200
property $id="cib-bootstrap-options" \
dc-version="1.0.12-066152e" \
cluster-infrastructure="Heartbeat" \
stonith-enabled="false" \
no-quorum-policy="ignore" \
default-action-timeout="120s" \
last-lrm-refresh="1441681923"
rsc_defaults $id="rsc-options" \
resource-stickiness="INFINITY"
ãŠæ‰‹æ•°ãŠã‹ã‘致ã—ã¾ã™ãŒã€ä½•å’宜ã—ããŠé¡˜ã„致ã—ã¾ã™ã€‚
以上
--
Naka