歡迎您光臨本站 註冊首頁

heartbeat 兩台HA能否監視服務

←手機掃碼閱讀     火星人 @ 2014-03-04 , reply:0

heartbeat 兩台HA能否監視服務

請教高人,我用heartbeat 做了兩台機器的apache的HA,一個做主一個做從。
發現只有當主上的 heartbeat服務停掉或心跳線完全斷開時才將apache服務及VIP切換到
從伺服器上。想問的是能不能做到監視服務狀態的,比如說當主上的apache停掉后,服務就會從主伺服器切換到從伺服器上?
《解決方案》

如果是hb2.0以上的話,完全可以

配製好/etc/ha.d/haresources和ha.cf后,調用 /usr/lib/heartbeat/haresources2cib.py

可以生成 /var/lib/heartbeat/crm/cib.xml

就可以對apache的狀態進行監測了。

如果不行,可以運行hb_gui,為apache資源添加一個monitor
《解決方案》

謝謝,樓上的兄弟,能不能說詳細點。
調用 /usr/lib/heartbeat/haresources2cib.py這個是自動調用還是要另外設置?
我用heartbeat-2.0.7.tar.gz做的不行!
或者有什麼技術文檔發點上來看看啊!
兄弟感激不盡!

[ 本帖最後由 smz0102 於 2007-11-2 17:20 編輯 ]
《解決方案》

我按你給的路子查了相關的資料
ha.cf里加上"crm 1"
寫好/etc/ha.d/haresources
執行
#/usr/lib/heartbeat/haresources2cib.py
然後將/etc/ha.d/haresources清空
我開啟的是apache監控,不能實現
請問能不能說詳細點,不勝感激!
《解決方案》

用heartbeat +heartbeat-ldriectord能完成吧!

[ 本帖最後由 zdszdszds 於 2007-11-9 16:27 編輯 ]
《解決方案》

原帖由 smz0102 於 2007-11-6 09:36 發表 http://linux.chinaunix.net/bbs/images/common/back.gif
我按你給的路子查了相關的資料
ha.cf里加上"crm 1"
寫好/etc/ha.d/haresources
執行
#/usr/lib/heartbeat/haresources2cib.py
然後將/etc/ha.d/haresources清空
我開啟的是apache監控,不能實現
請問能 ...


打開/var/lib/heartbeat/crm/cib.xml,看看有沒有該資源的monitor選項,如果沒有,用hb_gui 添加
《解決方案》

照我的做可以滿足你的要求

redhatAS4.2  安裝集群LVS

create in 20060812 by ghbspecial
環境描述:本文在配置LVS時使用三台linux,一台做Directorserver(192.168.0.25) ,兩台做realserver(192.168.0.127 192.168.0.12

,在配置lvs+heartbeat時又添加了一台(192.168.0.126)做為備份主節點,虛擬VIP:192.168.0.100
軟體列表:
ipvsadm-1.24.tar.gz
libnet.tar  下載地址:http://www.packetfactory.net/libnet/  穩定版本是:1.1.2.1
e2fsprogs    可以用rpm 安裝光碟
heartbeat-2.0.2.tar.gz 
2.6內核已經集成IPVS內核補訂了,所以不再需要重新編譯內核.
配置此集群分以下幾種情況
一、配置基於DR模式Lvs集群
二、配置基於隧道模式Lvs集群
三、配置基於高可用Lvs+heartbeat
四、此種配置方式可以加強LVS的主節點的高安全性前提下(主節點簡稱DR,備份主節點DRbak),考慮充分利用資源可以將DRbak做為realserver
一、配置基於DR模式Lvs集群
1、下載ipvsadm管理程序
http://www.linuxvirtualserver.org/software/   
注意對應自己的內核版本
ipvsadm-1.24.tar.gz
tar zxvf ipvsadm-1.24.tar.gz
cd ipvsadm-1.24
make && make install
注意在make時可能會出現很多錯誤的信息,請按照如下操作就可以心編譯正常
ln -s /usr/src/kernels/2.6.9-22.EL-i686/ /usr/src/linux
cd ipvsadm-1.24
make && make install
2、配置VIP腳本
#more /etc/init.d/lvsDR
#!/bin/sh
#create in 20060812 by ghb
# description: start LVS  of  Directorserver
VIP=192.168.0.100
RIP1=192.168.0.127
RIP2=192.168.0.128
#RIPn=192.168.0.128~254
GW=192.168.0.1
. /etc/rc.d/init.d/functions
case "$1" in
    start)
        echo " start LVS  of DirectorServer"
      # set the Virtual  IP Address
      /sbin/ifconfig eth0:0 $VIP broadcast $VIP netmask 255.255.255.255 up
      /sbin/route add -host $VIP dev eth0:0
      #Clear IPVS table
      /sbin/ipvsadm -C
      #set LVS
      /sbin/ipvsadm -A -t $VIP:80 -s rr  (如果需要session保持添加-p 默認保持300秒)
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP1:80 -g
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP2:80 -g
      #/sbin/ipvsadm -a -t $VIP:80 -r $RIP3:80 -g
      #Run LVS
      /sbin/ipvsadm
      #end
        ;;
    stop)
        echo "close LVS Directorserver"
        /sbin/ipvsadm -C
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac
(-s rr 是使用了輪叫演算法,可以自行選擇相應的演算法,更改rr就可以了,ipvsadm -h查看幫助。-g 是使用lvs工作DR直接路由模式,也可自行修改)
如果有多個realserver直接添加就可以了,之後啟動此腳本就可以了。
3、配置realserver腳本
#!/bin/bash
#description : start realserver
#create in 20060812 by ghb
VIP=192.168.0.100
/sbin/ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up
/sbin/route add -host $VIP dev lo:0
echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
sysctl -p
#end
此腳本使realserver不響應arp請求,將此腳本分別在realserver上執行就可以了。
測試:分別啟動realserver上的httpd服務
在realserver1 執行  echo "This is realserver1"  /var/www/html/index.html
在realserver2 執行  echo "This is realserver2"  /var/www/html/index.html
打開IE瀏覽器輸入http://192.168.0.100  應該可以分別看到:This is realserver1 和 This is realserver1.
二、配置基於隧道模式Lvs集群
1、安裝ipvsadmin方法和上面一樣,在此略過
2、配置LVS directorserver 腳本
# more /etc/init.d/tunlvs
#!/bin/sh
# description: start LVS  of  Directorserver
VIP=192.168.0.100
RIP1=192.168.0.127
RIP2=192.168.0.128
#RIPn=192.168.0.n
GW=192.168.0.1
. /etc/rc.d/init.d/functions
case "$1" in
    start)
        echo " start LVS  of DirectorServer"
      # set the Virtual  IP Address
      /sbin/ifconfig tunl0 $VIP broadcast $VIP netmask 255.255.255.255 up
      /sbin/route add -host $VIP dev tunl0
      #Clear IPVS table
      /sbin/ipvsadm -C
      #set LVS
      /sbin/ipvsadm -A -t $VIP:80 -s rr
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP1:80 -i
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP2:80 -i
      #/sbin/ipvsadm -a -t $VIP:80 -r $RIP3:80 -i
      #Run LVS
      /sbin/ipvsadm
      #end
        ;;
    stop)
        echo "close LVS Directorserver"
        ifconfig tunl0 down
        /sbin/ipvsadm -C
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac
3、配置realserver
# more /etc/init.d/tunl
#!/bin/sh
# ghb in 20060812
# description: Config realserver tunl port and apply arp patch
VIP=192.168.0.100
. /etc/rc.d/init.d/functions
case "$1" in
    start)
        echo "Tunl port starting"
        ifconfig tunl0 $VIP netmask 255.255.255.255 broadcast $VIP up
        /sbin/route add -host $VIP dev tunl0
        echo "1" >/proc/sys/net/ipv4/conf/tunl0/arp_ignore
        echo "2" >/proc/sys/net/ipv4/conf/tunl0/arp_announce
        echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
        echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
        sysctl -p
        ;;
    stop)
        echo "Tunl port closing"
        ifconfig tunl0 down
        echo 1 > /proc/sys/net/ipv4/ip_forward
        echo 0 > /proc/sys/net/ipv4/conf/all/arp_announce
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac
如果有多個Virutal IP,可以使用tunl0:0,tunl0:1...。
此腳本分別在realserver上執行,目的使realserver忽略arp響應,並設定vip.
測式同樣按照上面的方法測試
三、配置基於高可用Lvs+heartbeat
1、確定LVS使用DR或/tun模式,請對照上面的配置。
本例使用tun模式
Director server 端腳本文件
# more /etc/init.d/tunlvs
#!/bin/sh
# description: start LVS  of  Directorserver
VIP=192.168.0.100
RIP1=192.168.0.127
RIP2=192.168.0.128
#RIPn=192.168.0.n
GW=192.168.0.1
. /etc/rc.d/init.d/functions
case "$1" in
    start)
        echo " start LVS  of DirectorServer"
      # set the Virtual  IP Address
      /sbin/ifconfig tunl0 $VIP broadcast $VIP netmask 255.255.255.255 up
      /sbin/route add -host $VIP dev tunl0
      #Clear IPVS table
      /sbin/ipvsadm -C
      #set LVS
      /sbin/ipvsadm -A -t $VIP:80 -s rr
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP1:80 -i
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP2:80 -i
      #/sbin/ipvsadm -a -t $VIP:80 -r $RIP3:80 -i
      #Run LVS
      /sbin/ipvsadm
      #end
        ;;
    stop)
        echo "close LVS Directorserver"
        ifconfig tunl0 down
        /sbin/ipvsadm -C
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac
realserver端同樣使用上面的配置文件就可以。
2、安裝heartbeat
libnet.tar  下載地址:http://www.packetfactory.net/libnet/  穩定版本是:1.1.2.1
e2fsprogs    可以用rpm 安裝光碟
heartbeat-2.0.2.tar.gz      下載地址: http://www.linux-ha.org/download/
2.1安裝
tar -zxvf libnet.tar.gz
cd libnet
./configure
make
make install
tar zxf heartbeat-1.99.4.tar.gz
cd heartbeat-1.99.4
./ConfigureMe configure --disable-swig --disable-snmp-subagent
make
make install
cp doc/ha.cf doc/haresources doc/authkeys /etc/ha.d/
cp ldirectord/ldirectord.cf /etc/ha.d/
配置:
主配置文件(/etc/ha.d/ha.cf)
#debugfile /var/log/ha-debug
logfile /var/log/ha-log  #指名heartbeat的日誌存放位置
#crm yes #支持ClusterResourceManager(集群資源管理)功能
#bcast eth1 #指明心跳方式使用以太廣播方式,並且是在eth1介面上進行廣播。
logfacility local0
keepalive 2#指明心跳時間為2秒(即每兩秒鐘在eth1上發送一次廣播)。
deadtime 30#指定在30秒內沒有心跳信號,則立即切換服務。
warntime 10 #指明心跳延遲的時間為十秒。當10秒鐘內備份機不能聯繫上主機(當前活動的伺服器,即無心跳信號),就會往日誌中寫入一個警告日誌,但此時不會切換服務。
initdead 120  #With some configurations, the network takes some time to start working after a reboot. This is a separate  "deadtime" to  handle that case. It should be at least twice the normal deadtime.
udpport 694#Use port number 694 for bcast or ucast communication. This is the default, and the official IANA registered port number.
baud 19200
serial /dev/ttyS0
mcast eth0 225.0.0.1 694 1 0
# 當主節點恢復后,是否自動切回
auto_failback on
# stonith用來保證共享存儲環境中的數據完整性
#stonith baytech /etc/ha.d/conf/stonith.baytech
# watchdog能讓系統在出現故障1分鐘后重啟該機器。這個功能可以幫助伺服器在確實停止心跳后能夠重新恢復心跳。
# 如果使用該特性,則在內核中裝入"softdog"內核模塊,用來生成實際的設備文件,輸入"insmod softdog"載入模塊。
# 輸入"grep misc /proc/devices"(應為10),輸入"cat /proc/misc | grep watchdog"(應為130)。
# 生成設備文件:"mknod /dev/watchdog c 10 130" 。
#watchdog /dev/watchdog
node ns.ghb.com  #Mandatory. Hostname of machine in cluster as described by uname -n.
node nsbak.ghb.com
# 默認heartbeat並不檢測除本身之外的其他任何服務,也不檢測網路狀況。
# 所以當網路中斷時,並不會進行Load Balancer和Backup之間的切換。
# 可以通過ipfail插件,設置'ping nodes'來解決這一問題。詳細說明參考hearbeat文檔。
#ping 192.168.136.1 172.16.0.1
ping_group group1 192.168.0.25 192.168.0.126
respawn root /usr/lib/heartbeat/ipfail
apiauth ipfail gid=root uid=root
# 其他一些插件可以在/usr/lib/heartbeat下找到
#apiauth ipfail uid=hacluster
#apiauth ccm uid=hacluster
#apiauth cms uid=hacluster
#apiauth ping gid=haclient uid=alanr,root
#apiauth default gid=haclient
資源文件(/etc/ha.d/haresources):
ns.ghb.com IPaddr::192.168.0.127/24/eth0 httpd
#設置ns.ghb.com為主節點,集群伺服器的ip地址為192.168.0.100 netmask 為255.255.255.240集群的服務有httpd
認證文件(/etc/ha.d/authkeys),選取一種認證方式,這個文件的許可權必須是600
auth 1
1 crc
#2 sha1 sha1_any_password
#3 md5 md5_any_password
使用同樣的方法配置節點2
備份節點192.168.0.126 上的heartbeat和apache的配置與節點1要完全相同,lvs配置也要相同。
2.2
完裝完畢進行測試,關閉主節點機器,另一台自動接管,主節點恢復后自動接管回服務。如果以上測試沒有問題,那麼開始和lvs整合。
配置Ldirectord
Ldirectord的作用是監測Real Server,當Real Server失效時,把它從Load Balancer列表中刪除,恢復時重新添加,在安裝heartbeat時已經安裝了Ldirectord。
配置(/etc/ha.d/ldirectord.cf):
# Global Directives
checktimeout=3
checkinterval=1
fallback=127.0.0.1:80
autoreload=yes
logfile="/var/log/ldirectord.log"
quiescent=yes
# A sample virual with a fallback that will override the gobal setting
virtual=192.168.0.100:80
        real=192.168.0.127:80  gate
        real=192.168.0.128:80 gate
        fallback=127.0.0.1:80  gate
        service=http
        request="test.html"
        receive="Test Page"
        virtualhost=www.funbsd.net
        scheduler=rr
        #persistent=600
        #netmask=255.255.255.255
        protocol=tcp
在每個Real Server的中添加監控頁:
echo "Test Page" >> /var/www/html/test.html 
修改heartbeat的資源文件/etc/ha.d/haresources
ns.ghb.com 192.168.0.100 tunlvs ldirectord httpd
現在可以在主節點192.168.0.25上啟動heartbeat
/etc/init.d/heartbeat start
在備份節點也啟動heartbeat  /etc/init.d/heartbeat start
測試:關閉主節點,備份節點將自動接管directorserver服務。(主節點正常時用ifconfig 是可以看tunl接可口的,而備份節點用ifconfig 命令是看不到的,只有在接管主節點服務后才是可以見的)
至此第三部分配置完畢。
四、考慮充份使用資源,將備份節點也做為realserver.
在主備director server 上都要做如下配置
1.director server 需要在腳本文件中將添加realserver,我們預先設置所有機器為realserver。
#!/bin/sh
# description: start LVS  of  Directorserver
VIP=192.168.0.100
RIP1=192.168.0.127
RIP2=192.168.0.128
RIP3=192.168.0.25
RIP4=192.168.0.126
GW=192.168.0.1
. /etc/rc.d/init.d/functions
case "$1" in
    start)
        echo " start LVS  of DirectorServer"
      # set the Virtual  IP Address
      /sbin/ifconfig tunl0 $VIP broadcast $VIP netmask 255.255.255.255 up
      /sbin/route add -host $VIP dev tunl0
      #Clear IPVS table
      /sbin/ipvsadm -C
      #set LVS
      /sbin/ipvsadm -A -t $VIP:80 -s rr
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP1:80 -i
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP2:80 -i
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP3:80 -i
      /sbin/ipvsadm -a -t $VIP:80 -r $RIP3:80 -i
      #Run LVS
      /sbin/ipvsadm
      #end
        ;;
    stop)
        echo "close LVS Directorserver"
        ifconfig tunl0 down
        /sbin/ipvsadm -C
        ;;
    *)
        echo "Usage: $0 {start|stop}"
        exit 1
esac
2.修改/etc/ha.d/ldirectord.cf
# Global Directives
checktimeout=3
checkinterval=1
fallback=127.0.0.1:80
autoreload=yes
logfile="/var/log/ldirectord.log"
quiescent=yes
# A sample virual with a fallback that will override the gobal setting
virtual=192.168.0.100:80
        real=192.168.0.126:80  gate
        real=192.168.0.127:80  gate
        real=192.168.0.128:80  gate
        real=192.168.0.25:80  gate
        fallback=127.0.0.1:80  gate
        service=http
        request="test.html"
        receive="Test Page"
        virtualhost=www.funbsd.net
        scheduler=rr
        #persistent=600
        #netmask=255.255.255.255
        protocol=tcp
3、將realserver的啟動腳本加入到主節點,和備份節點中,並且這個腳本的啟動級必須先於heartbeat,關閉級必須後於heartbeat
chkconfig  tunl  on 添加到系統啟動
4、創建closetunl啟動腳本,為啟動director server 做準備
more /etc/init.d/closetunl
#!/bin/sh
# create in 200608 ghb
# description: close tunl0 and arp_ignore
VIP=192.168.0.100
. /etc/rc.d/init.d/functions
case "$1" in
    start)
        echo "start director server and close tunl"
        ifconfig tunl0 down
        echo 1 > /proc/sys/net/ipv4/ip_forward
        echo 0 > /proc/sys/net/ipv4/conf/all/arp_announce
        ;;
    stop)
        echo "start Real Server"
        ifconfig tunl0 $VIP netmask 255.255.255.255 broadcast $VIP up
        /sbin/route add -host $VIP dev tunl0
        echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
        echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
        echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
        echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
        sysctl -p
        ;;
    *)
        echo "Usage: lvs {start|stop}"
        exit 1
esac
chmod 755 /etc/init.d/closetunl
5、修改/etc/ha.d/haresources
ns.wdxc.com closetunl 192.168.0.100  tunlvs ldirectord httpd
6、測試
http://192.168.0.100  應該可以輪到四台機器上
配置完畢
《解決方案》

7樓的 寫的全
打算試驗一下
《解決方案》

謝謝各位,我試一下!
《解決方案》

我的
# cat /var/lib/heartbeat/crm/cib.xml
<cib admin_epoch="0" epoch="1" num_updates="25" have_quorum="true" generated="true" num_peers="1" ccm_transition="3" cib_feature_revision="1.3" dc_uuid="0a580fe4-9dca-4ecf-9495-1e2246e8614a" cib-last-written="Mon Nov  5 19:17:36 2007">
   <configuration>
     <crm_config>
       <cluster_property_set id="cib-bootstrap-options">
         <attributes>
           <nvpair id="cib-bootstrap-options-symmetric_cluster" name="symmetric_cluster" value="true"/>
           <nvpair id="cib-bootstrap-options-no_quorum_policy" name="no_quorum_policy" value="stop"/>
           <nvpair id="cib-bootstrap-options-default_resource_stickiness" name="default_resource_stickiness" value="0"/>
           <nvpair id="cib-bootstrap-options-default_resource_failure_stickiness" name="default_resource_failure_stickiness" value="0"/>
           <nvpair id="cib-bootstrap-options-stonith_enabled" name="stonith_enabled" value="false"/>
           <nvpair id="cib-bootstrap-options-stonith_action" name="stonith_action" value="reboot"/>
           <nvpair id="cib-bootstrap-options-stop_orphan_resources" name="stop_orphan_resources" value="true"/>
           <nvpair id="cib-bootstrap-options-stop_orphan_actions" name="stop_orphan_actions" value="true"/>
           <nvpair id="cib-bootstrap-options-remove_after_stop" name="remove_after_stop" value="false"/>
           <nvpair id="cib-bootstrap-options-short_resource_names" name="short_resource_names" value="true"/>
           <nvpair id="cib-bootstrap-options-transition_idle_timeout" name="transition_idle_timeout" value="5min"/>
           <nvpair id="cib-bootstrap-options-default_action_timeout" name="default_action_timeout" value="5s"/>
           <nvpair id="cib-bootstrap-options-is_managed_default" name="is_managed_default" value="true"/>
         </attributes>
       </cluster_property_set>
     </crm_config>
     <nodes>
       <node id="0a580fe4-9dca-4ecf-9495-1e2246e8614a" uname="node2.test.com" type="normal"/>
       <node id="1b22bff9-b024-44af-b593-9c7bbe2e762d" uname="node1.test.com" type="normal"/>
     </nodes>
     <resources>
       <group id="group_1">
         <primitive class="ocf" id="IPaddr_192_168_0_160" provider="heartbeat" type="IPaddr">
           <operations>
             <op id="IPaddr_192_168_0_160_mon" interval="5s" name="monitor" timeout="5s"/>
           </operations>
           <instance_attributes id="IPaddr_192_168_0_160_inst_attr">
             <attributes>
               <nvpair id="IPaddr_192_168_0_160_attr_0" name="ip" value="192.168.0.160"/>
               <nvpair id="IPaddr_192_168_0_160_attr_1" name="netmask" value="24"/>
               <nvpair id="IPaddr_192_168_0_160_attr_2" name="nic" value="eth0"/>
             </attributes>
           </instance_attributes>
         </primitive>
         <primitive class="lsb" id="httpd_2" provider="heartbeat" type="httpd">
           <operations>
             <op id="httpd_2_mon" interval="120s" name="monitor" timeout="60s"/>
           </operations>
         </primitive>
       </group>
     </resources>
     <constraints>
       <rsc_location id="rsc_location_group_1" rsc="group_1">
         <rule id="prefered_location_group_1" score="100">
           <expression attribute="#uname" id="prefered_location_group_1_expr" operation="eq" value="node1.test.com"/>
         </rule>
       </rsc_location>
     </constraints>
   </configuration>
</cib>
# vi /var/lib/heartbeat/crm/cib.xml

<cib admin_epoch="0" epoch="1" num_updates="25" have_quorum="true" generated="true" num_peers="1" ccm_transition="3" cib_feature_revision="1.3" dc_uuid="0a580fe4-9dca-4ecf-9495-1e2246e8614a" cib-last-written="Mon Nov  5 19:17:36 2007">
   <configuration>
     <crm_config>
       <cluster_property_set id="cib-bootstrap-options">
         <attributes>
           <nvpair id="cib-bootstrap-options-symmetric_cluster" name="symmetric_cluster" value="true"/>
           <nvpair id="cib-bootstrap-options-no_quorum_policy" name="no_quorum_policy" value="stop"/>
           <nvpair id="cib-bootstrap-options-default_resource_stickiness" name="default_resource_stickiness" value="0"/>
           <nvpair id="cib-bootstrap-options-default_resource_failure_stickiness" name="default_resource_failure_stickiness" value="0"/>
           <nvpair id="cib-bootstrap-options-stonith_enabled" name="stonith_enabled" value="false"/>
           <nvpair id="cib-bootstrap-options-stonith_action" name="stonith_action" value="reboot"/>
           <nvpair id="cib-bootstrap-options-stop_orphan_resources" name="stop_orphan_resources" value="true"/>
           <nvpair id="cib-bootstrap-options-stop_orphan_actions" name="stop_orphan_actions" value="true"/>
           <nvpair id="cib-bootstrap-options-remove_after_stop" name="remove_after_stop" value="false"/>
           <nvpair id="cib-bootstrap-options-short_resource_names" name="short_resource_names" value="true"/>
           <nvpair id="cib-bootstrap-options-transition_idle_timeout" name="transition_idle_timeout" value="5min"/>
           <nvpair id="cib-bootstrap-options-default_action_timeout" name="default_action_timeout" value="5s"/>
           <nvpair id="cib-bootstrap-options-is_managed_default" name="is_managed_default" value="true"/>
         </attributes>
       </cluster_property_set>
     </crm_config>
     <nodes>
       <node id="0a580fe4-9dca-4ecf-9495-1e2246e8614a" uname="node2.test.com" type="normal"/>
       <node id="1b22bff9-b024-44af-b593-9c7bbe2e762d" uname="node1.test.com" type="normal"/>
     </nodes>
     <resources>
       <group id="group_1">
         <primitive class="ocf" id="IPaddr_192_168_0_160" provider="heartbeat" type="IPaddr">
           <operations>
             <op id="IPaddr_192_168_0_160_mon" interval="5s" name="monitor" timeout="5s"/>
           </operations>
           <instance_attributes id="IPaddr_192_168_0_160_inst_attr">
             <attributes>
               <nvpair id="IPaddr_192_168_0_160_attr_0" name="ip" value="192.168.0.160"/>
               <nvpair id="IPaddr_192_168_0_160_attr_1" name="netmask" value="24"/>
               <nvpair id="IPaddr_192_168_0_160_attr_2" name="nic" value="eth0"/>
             </attributes>
           </instance_attributes>
         </primitive>
         <primitive class="lsb" id="httpd_2" provider="heartbeat" type="httpd">
           <operations>
             <op id="httpd_2_mon" interval="120s" name="monitor" timeout="60s"/>
           </operations>

[火星人 ] heartbeat 兩台HA能否監視服務已經有735次圍觀

http://coctec.com/docs/service/show-post-7860.html