歡迎您光臨本站 註冊首頁

hearbeat問題,服務無效?

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

hearbeat問題,服務無效?

# hostname
linuxone.com
# service httpd restart  #啟動正常


配置文件:
vi /etc/ha.d/haresources
linuxone.com 192.168.0.194/25/192.168.0.255 httpd

vi /etc/ha.d/ha.cf
logfile /var/log/ha_log
bcast eth1
keepalive 2
warntime 10
deadtime 30
initdead 120
hopfudge 1
udpport 694
auto_failback on
node linuxone.com
node linuxtwo.com
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail gid=root uid=root

vi /etc/ha.d/authkeys
auth 1
1 crc
#2 sha1 HI!
#3 md5 Hello!




#/etc/init.d/heartbeat start
Starting High-Availability services:
2006/07/26_04:58:24 INFO:  Resource is stopped
                                                           [  OK  ]
# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:0C:29:53:96:83
          inet addr:192.168.0.192  Bcast:192.168.0.255  Mask:255.255.255.0
          inet6 addr: fe80::20c:29ff:fe53:9683/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:5604 errors:0 dropped:0 overruns:0 frame:0
          TX packets:630 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:538403 (525.7 KiB)  TX bytes:78743 (76.8 KiB)
          Interrupt:185 Base address:0x2000

eth1      Link encap:Ethernet  HWaddr 00:0C:29:53:96:8D
          inet addr:1.1.1.1  Bcast:1.255.255.255  Mask:255.0.0.0
          inet6 addr: fe80::20c:29ff:fe53:968d/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:6307 errors:1 dropped:1 overruns:0 frame:0
          TX packets:27 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:604224 (590.0 KiB)  TX bytes:2977 (2.9 KiB)
          Interrupt:177 Base address:0x2080

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:760 (760.0 b)  TX bytes:760 (760.0 b)


沒有出現傳說中的eth0:0,httpd服務也沒有起來,這是什麼原因呢,請指教!
《解決方案》

heartbeat: 2006/07/26_04:20:11 info: Version 2 support: false
heartbeat: 2006/07/26_04:20:12 WARN: Logging daemon is disabled --enabling logging daemon is recommended
heartbeat: 2006/07/26_04:20:12 info: **************************
heartbeat: 2006/07/26_04:20:12 info: Configuration validated. Starting heartbeat 2.1.1
heartbeat: 2006/07/26_04:20:12 info: heartbeat: version 2.1.1
heartbeat: 2006/07/26_04:20:12 info: Heartbeat generation: 1153851240
heartbeat: 2006/07/26_04:20:12 info: G_main_add_TriggerHandler: Added signal manual handler
heartbeat: 2006/07/26_04:20:12 info: G_main_add_TriggerHandler: Added signal manual handler
heartbeat: 2006/07/26_04:20:12 info: Removing /var/run/heartbeat/rsctmp failed, recreating.
heartbeat: 2006/07/26_04:20:12 info: glib: UDP Broadcast heartbeat started on port 694 (694) interface eth1
heartbeat: 2006/07/26_04:20:12 info: glib: UDP Broadcast heartbeat closed on port 694 interface eth1 - Status: 1
heartbeat: 2006/07/26_04:20:12 info: G_main_add_SignalHandler: Added signal handler for signal 17
heartbeat: 2006/07/26_04:20:12 info: Local status now set to: 'up'
heartbeat: 2006/07/26_04:20:13 info: Link linuxone.com:eth1 up.
heartbeat: 2006/07/26_04:20:25 info: Link linuxtwo.com:eth1 up.
heartbeat: 2006/07/26_04:20:25 info: Status update for node linuxtwo.com: status up
harc:     2006/07/26_04:20:25 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2006/07/26_04:20:26 info: Comm_now_up(): updating status to active
heartbeat: 2006/07/26_04:20:26 info: Local status now set to: 'active'
heartbeat: 2006/07/26_04:20:26 info: Starting child client "/usr/lib/heartbeat/ipfail" (500,500)
heartbeat: 2006/07/26_04:20:26 info: Status update for node linuxtwo.com: status active
heartbeat: 2006/07/26_04:20:26 info: Starting "/usr/lib/heartbeat/ipfail" as uid 500  gid 500 (pid 3878)
heartbeat: 2006/07/26_04:20:26 WARN: Client pid 3878 failed authorization
heartbeat: 2006/07/26_04:20:26 ERROR: api_process_registration_msg: cannot add client(ipfail)
heartbeat: 2006/07/26_04:20:26 WARN: Exiting /usr/lib/heartbeat/ipfail process 3878 returned rc 100.
harc:     2006/07/26_04:20:26 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2006/07/26_04:20:36 info: remote resource transition completed.
heartbeat: 2006/07/26_04:20:36 info: remote resource transition completed.
heartbeat: 2006/07/26_04:20:36 info: Initial resource acquisition complete (T_RESOURCES(us))
heartbeat: 2006/07/26_04:20:36 ERROR: pclose(/usr/lib/heartbeat/ResourceManager listkeys linuxone.com) exited with retur
n code 127
heartbeat: 2006/07/26_04:20:36 ERROR: exited with return code
127
heartbeat: 2006/07/26_04:20:36 info: No local resources to ac
quire.
heartbeat: 2006/07/26_04:20:55 info: Received shutdown notice from 'linuxtwo.com'.
heartbeat: 2006/07/26_04:20:55 info: Resources being acquired from linuxtwo.com.
heartbeat: 2006/07/26_04:20:55 info: acquire local HA resources (standby).
heartbeat: 2006/07/26_04:20:55 ERROR: pclose(/usr/lib/heartbeat/ResourceManager ourkeys) exited with return code 127
heartbeat: 2006/07/26_04:20:55 info: local HA resource acquisition completed (standby).
heartbeat: 2006/07/26_04:20:55 info: Standby resource acquisition done .
heartbeat: 2006/07/26_04:20:55 ERROR: pclose(/usr/lib/heartbeat/ResourceManager listkeys linuxone.com) exited with retur
n code 127
heartbeat: 2006/07/26_04:20:55 ERROR: exited with return code
127
heartbeat: 2006/07/26_04:20:55 info: No local resources to ac
quire.
harc:     2006/07/26_04:20:55 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2006/07/26_04:20:59 WARN: Shutdown delayed until current resource activity finishes.
heartbeat: 2006/07/26_04:21:26 WARN: node linuxtwo.com: is dead
heartbeat: 2006/07/26_04:21:26 info: Link linuxtwo.com:eth1 dead.
heartbeat: 2006/07/26_04:21:44 WARN: Gmain_timeout_dispatch: Dispatch function for send local status took too long to ex
ecute: 210 ms (> 50 ms) (GSource: 0x865fb70)
heartbeat: 2006/07/26_04:21:44 WARN: G_CH_prepare_int: working on write child took 170 ms (> 100 ms)
heartbeat: 2006/07/26_04:21:54 ERROR: glib: Unable to send bcast [-1] packet(len=181): No such device
heartbeat: 2006/07/26_04:21:54 ERROR: MSG: Dumping message with 12 fields
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG : [(1)srcuuid=0x8660350(36 27)]
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: MSG :
heartbeat: 2006/07/26_04:21:54 ERROR: write failure on bcast eth1.: No such device
heartbeat: 2006/07/26_04:21:55 ERROR: glib: Unable to send bcast [-1] packet(len=181): No such device
heartbeat: 2006/07/26_04:21:55 ERROR: MSG: Dumping message with 12 fields
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG : [(1)srcuuid=0x865bce0(36 27)]
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: MSG :
heartbeat: 2006/07/26_04:21:55 ERROR: write failure on bcast eth1.: No such device
heartbeat: 2006/07/26_04:21:56 ERROR: glib: Unable to send bcast [-1] packet(len=181): No such device
heartbeat: 2006/07/26_04:21:56 ERROR: MSG: Dumping message with 12 fields
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG : [(1)srcuuid=0x8660580(36 27)]
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: MSG :
heartbeat: 2006/07/26_04:21:56 ERROR: write failure on bcast eth1.: No such device
heartbeat: 2006/07/26_04:21:58 ERROR: glib: Unable to send bcast [-1] packet(len=181): No such device
heartbeat: 2006/07/26_04:21:58 ERROR: MSG: Dumping message with 12 fields
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG : [(1)srcuuid=0x865ffb0(36 27)]
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: MSG :
heartbeat: 2006/07/26_04:21:58 ERROR: write failure on bcast eth1.: No such device
heartbeat: 2006/07/26_04:22:00 ERROR: glib: Unable to send bcast [-1] packet(len=181): No such device
heartbeat: 2006/07/26_04:22:00 ERROR: MSG: Dumping message with 12 fields
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG : [(1)srcuuid=0x8660430(36 27)]
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: MSG :
heartbeat: 2006/07/26_04:22:00 ERROR: write failure on bcast eth1.: No such device
heartbeat: 2006/07/26_04:22:02 ERROR: glib: Unable to send bcast [-1] packet(len=181): No such device
heartbeat: 2006/07/26_04:22:02 ERROR: MSG: Dumping message with 12 fields
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG : [(1)srcuuid=0x8660468(36 27)]
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: MSG :
heartbeat: 2006/07/26_04:22:02 ERROR: write failure on bcast eth1.: No such device
heartbeat: 2006/07/26_04:58:24 info: Version 2 support: false
heartbeat: 2006/07/26_04:58:24 WARN: Logging daemon is disabled --enabling logging daemon is recommended
heartbeat: 2006/07/26_04:58:24 info: **************************
heartbeat: 2006/07/26_04:58:24 info: Configuration validated. Starting heartbeat 2.1.1
heartbeat: 2006/07/26_04:58:24 info: heartbeat: version 2.1.1
heartbeat: 2006/07/26_04:58:24 info: Heartbeat generation: 1153851241
heartbeat: 2006/07/26_04:58:24 info: G_main_add_TriggerHandler: Added signal manual handler
heartbeat: 2006/07/26_04:58:24 info: G_main_add_TriggerHandler: Added signal manual handler
heartbeat: 2006/07/26_04:58:24 info: Removing /var/run/heartbeat/rsctmp failed, recreating.
heartbeat: 2006/07/26_04:58:24 info: glib: UDP Broadcast heartbeat started on port 694 (694) interface eth1
heartbeat: 2006/07/26_04:58:24 info: glib: UDP Broadcast heartbeat closed on port 694 interface eth1 - Status: 1
heartbeat: 2006/07/26_04:58:24 info: G_main_add_SignalHandler: Added signal handler for signal 17
heartbeat: 2006/07/26_04:58:24 info: Local status now set to: 'up'
heartbeat: 2006/07/26_04:58:25 info: Link linuxone.com:eth1 up.
heartbeat: 2006/07/26_04:58:26 info: Link linuxtwo.com:eth1 up.
heartbeat: 2006/07/26_04:58:26 info: Status update for node linuxtwo.com: status active
harc:     2006/07/26_04:58:26 info: Running /etc/ha.d/rc.d/status status
heartbeat: 2006/07/26_04:58:26 info: Comm_now_up(): updating status to active
heartbeat: 2006/07/26_04:58:26 info: Local status now set to: 'active'
heartbeat: 2006/07/26_04:58:26 info: Starting child client "/usr/lib/heartbeat/ipfail" (500,500)
heartbeat: 2006/07/26_04:58:26 info: Starting "/usr/lib/heartbeat/ipfail" as uid 500  gid 500 (pid 3851)
heartbeat: 2006/07/26_04:58:26 WARN: Client pid 3851 failed authorization
heartbeat: 2006/07/26_04:58:26 ERROR: api_process_registration_msg: cannot add client(ipfail)
heartbeat: 2006/07/26_04:58:26 WARN: Exiting /usr/lib/heartbeat/ipfail process 3851 returned rc 100.
heartbeat: 2006/07/26_04:58:27 info: remote resource transition completed.
heartbeat: 2006/07/26_04:58:27 info: remote resource transition completed.
heartbeat: 2006/07/26_04:58:27 info: Local Resource acquisition completed. (none)
heartbeat: 2006/07/26_04:58:27 info: linuxtwo.com wants to go standby
heartbeat: 2006/07/26_04:58:28 info: standby: acquire resources from linuxtwo.com
heartbeat: 2006/07/26_04:58:28 info: acquire local HA resources (standby).
heartbeat: 2006/07/26_04:58:28 ERROR: pclose(/usr/lib/heartbeat/ResourceManager ourkeys) exited with return code 127
heartbeat: 2006/07/26_04:58:28 info: local HA resource acquisition completed (standby).
heartbeat: 2006/07/26_04:58:28 info: Standby resource acquisition done .
heartbeat: 2006/07/26_04:58:28 info: Initial resource acquisition complete (auto_failback)
heartbeat: 2006/07/26_04:58:29 info: remote resource transition completed.
heartbeat: 2006/07/26_04:58:36 info: Version 2 support: false
heartbeat: 2006/07/26_04:58:36 WARN: Logging daemon is disabled --enabling logging daemon is recommended
heartbeat: 2006/07/26_04:58:36 info: **************************
heartbeat: 2006/07/26_04:58:36 info: Configuration validated. Starting heartbeat 2.1.1
heartbeat: 2006/07/26_04:58:36 info: heartbeat: already running .
# vi /var/log/ha_log
heartbeat: 2006/07/26_04:58:36 info: heartbeat: already running .
《解決方案》

原帖由 doking2008 於 2007-7-27 16:08 發表 http://linux.chinaunix.net/bbs/images/common/back.gif
# hostname
linuxone.com
#


沒有出現傳說中的eth0:0,httpd服務也沒有起來,這是什麼原因呢,請指教!



httpd服務沒啟動起來, eth0:0就不會出現,httpd服務沒啟動,是你本機的問題,先把你httpd啟起來再說。

不過你上面又說" service httpd restart  #啟動正常" ,這個估計是RH給的錯誤提示吧。

Note: httpd and smb are the name of startup scripts for Apache and Samba, respectively. Heartbeat will look for startup scripts of the same name in the following paths:

/etc/ha.d/resource.d
/etc/init.d

我在Debian下apache的服務名是/etc/init.d/apache,開始我用httpd也不行,
後來修改配置文件:
vi /etc/ha.d/haresources
linuxone.com 192.168.0.194/25/192.168.0.255 httpd ->把httpd 換成apache就可以了。
你看看你機上的服務名叫什麼再說吧
《解決方案》

我裝的是httpd-2.2.4.tar.gz,
httpd我手工是可以起來的
/usr/local/apache2/bin/apachect1 start
netstat -utln
出現80埠
《解決方案》

# service httpd start
# netstat -utln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:821                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:631                 0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 :::80                       :::*                        LISTEN            
tcp        0      0 :::22                       :::*                        LISTEN
udp        0      0 0.0.0.0:815                 0.0.0.0:*                       
udp        0      0 0.0.0.0:818                 0.0.0.0:*                       
udp        0      0 0.0.0.0:111                 0.0.0.0:*                       
udp        0      0 0.0.0.0:631                 0.0.0.0:*                       
# service httpd stop
# netstat -utln
Active Internet connections (only servers)
Proto Recv-Q Send-Q Local Address               Foreign Address             State
tcp        0      0 0.0.0.0:111                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:821                 0.0.0.0:*                   LISTEN
tcp        0      0 0.0.0.0:631                 0.0.0.0:*                   LISTEN
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN
tcp        0      0 :::22                       :::*                        LISTEN
udp        0      0 0.0.0.0:815                 0.0.0.0:*                       
udp        0      0 0.0.0.0:818                 0.0.0.0:*                       
udp        0      0 0.0.0.0:111                 0.0.0.0:*                       
udp        0      0 0.0.0.0:631                 0.0.0.0:*  

這上面可以看出80埠是可以起來的
《解決方案》

原帖由 doking2008 於 2007-7-30 08:56 發表 http://linux.chinaunix.net/bbs/images/common/back.gif
我裝的是httpd-2.2.4.tar.gz,
httpd我手工是可以起來的
/usr/local/apache2/bin/apachect1 start
netstat -utln
出現80埠

我上一帖子指出的這個,你怎麼不看。
Note: httpd and smb are the name of startup scripts for Apache and Samba, respectively. Heartbeat will look for startup scripts of the same name in the following paths:

/etc/ha.d/resource.d
/etc/init.d
《解決方案》

簡單的用中文說就是,ha會到/etc/ini.d/目錄下找指定的服務,用於與之配合,這樣啟動后才行,不然你手動啟動的,不行。

可以試試,手動啟動apache,再手動重啟ha,這樣在我機上實驗可以(服務可以維持大約10秒,10秒內集群IP可對外服務,過一會集群IP就被自動釋放了)。

想永久解決問題,還是得處理上面帖子指出的問題。

[ 本帖最後由 qintel 於 2007-7-30 11:06 編輯 ]
《解決方案》

強烈建議你,先別搞的那麼複雜,先走一遍過程再說,搞個rpm的先試試.
還有,剛才看了日誌,authkey這個文件配置對了嗎.
《解決方案》

為了搞清楚原因,我重新安裝了系統和軟體,步驟如下:
操作系統:centos4.4

虛擬機1:
eth0:192.168.0.192
eth1:1.1.1.1
虛擬機2:
eth0:192.168.0.193
eth1:1.1.1.2

#hostname
linuxone.com

#vi /etc/sysconfig/network
NETWORKING=yes
HOSTNAME=linuxone.com

#vi /etc/hosts
127.0.0.1               localhost.localdomain localhost
192.168.0.192           linuxone.com
192.168.0.193           linuxtwo.com
1.1.1.1                 linuxone.com
1.1.1.2                 linuxtwo.com

安裝軟體包:
httpd-2.2.4.tar.gz
heartbeat-2.0.2.tar.gz
libnet.tar.gz

步驟1:
tar -zxvf httpd-2.2.4.tar.gz
cd httpd-2.2.4
./configure --prefix=/usr/local/apache2 --enable-so
make
make install
完成後,
/usr/local/apache2/bin/apachect1 start
cp /usr/local/apache2/bin/apachect1 /etc/init.d/httpd
service httpd restart
可以看到80埠起來

步驟2:
tar -zxvf libnet.tar.gz
cd libnet
./configure
make
make install

步驟3:
tar -zxvf heartbeat-2.0.2.tar.gz
cd heartbeat-2.0.2
./ConfigureMe configure
make
make install

配置文件:
vi /etc/ha.d/haresources
linuxone.com 192.168.0.194/25/192.168.0.255 httpd

vi /etc/ha.d/ha.cf
logfile /var/log/ha_log
bcast eth1
keepalive 2
warntime 10
deadtime 30
initdead 120
hopfudge 1
udpport 694
auto_failback on
node linuxone.com
node linuxtwo.com
respawn hacluster /usr/lib/heartbeat/ipfail
apiauth ipfail gid=root uid=root

/etc/ha.d/authkeys文件的內容如下:
auth 1
1 sha1 key-for-sha1-any-text-you-want

更改文件的許可權:
chmod 600 /etc/ha.d/authkeys

useradd -g root hacluster
groupadd -g root haclient  #沒有的話會報用戶ID錯誤。


啟動服務:
/etc/init.d/heartbeat start
# /etc/init.d/heartbeat start
logd is already running
Starting High-Availability services:
                                                           [  OK  ]


沒有發現80埠,也沒有eht0:0
《解決方案》

附上日誌:
vi /etc/log/ha_log
heartbeat: 2007/08/05_01:20:26 WARN: Logging daemon is disabled --enabling logging daemon is recommended
heartbeat: 2007/08/05_01:20:26 info: **************************
heartbeat: 2007/08/05_01:20:26 info: Configuration validated. Starting heartbeat 2.0.2
heartbeat: 2007/08/05_01:20:26 info: heartbeat: version 2.0.2
heartbeat: 2007/08/05_01:20:26 info: Heartbeat generation: 6
heartbeat: 2007/08/05_01:20:26 info: Removing /var/run/heartbeat/rsctmp failed, recreating.
heartbeat: 2007/08/05_01:20:26 info: glib: UDP Broadcast heartbeat started on port 694 (694) interface eth1
heartbeat: 2007/08/05_01:20:26 info: G_main_add_SignalHandler: Added signal handler for signal 17
heartbeat: 2007/08/05_01:20:26 info: pid 24179 locked in memory.
heartbeat: 2007/08/05_01:20:26 info: Local status now set to: 'up'
heartbeat: 2007/08/05_01:20:27 info: pid 24181 locked in memory.
heartbeat: 2007/08/05_01:20:27 info: pid 24183 locked in memory.
heartbeat: 2007/08/05_01:20:27 info: pid 24182 locked in memory.
heartbeat: 2007/08/05_01:20:27 info: Link linuxone.com:eth1 up.
heartbeat: 2007/08/05_01:20:48 WARN: Shutdown delayed until Communication is up.
heartbeat: 2007/08/05_01:21:04 WARN: Shutdown delayed until Communication is up.
heartbeat: 2007/08/05_01:21:32 CRIT: Emergency Shutdown: Master Control process died.
heartbeat: 2007/08/05_01:21:32 CRIT: Killing pid 24179 with SIGTERM
heartbeat: 2007/08/05_01:21:32 CRIT: Killing pid 24182 with SIGTERM
heartbeat: 2007/08/05_01:21:32 CRIT: Killing pid 24183 with SIGTERM
heartbeat: 2007/08/05_01:21:32 CRIT: Emergency Shutdown(MCP dead): Killing ourselves.
heartbeat: 2007/08/05_01:21:43 WARN: Logging daemon is disabled --enabling logging daemon is recommended
heartbeat: 2007/08/05_01:21:43 info: **************************
heartbeat: 2007/08/05_01:21:43 info: Configuration validated. Starting heartbeat 2.0.2
heartbeat: 2007/08/05_01:21:43 info: heartbeat: version 2.0.2
heartbeat: 2007/08/05_01:21:43 info: Heartbeat generation: 7
heartbeat: 2007/08/05_01:21:43 info: Removing /var/run/heartbeat/rsctmp failed, recreating.
heartbeat: 2007/08/05_01:21:43 info: glib: UDP Broadcast heartbeat started on port 694 (694) interface eth1
heartbeat: 2007/08/05_01:21:43 info: pid 24281 locked in memory.
heartbeat: 2007/08/05_01:21:43 info: G_main_add_SignalHandler: Added signal handler for signal 17
heartbeat: 2007/08/05_01:21:43 info: pid 24278 locked in memory.
heartbeat: 2007/08/05_01:21:43 info: Local status now set to: 'up'
heartbeat: 2007/08/05_01:21:44 info: pid 24282 locked in memory.
heartbeat: 2007/08/05_01:21:44 info: pid 24283 locked in memory.
heartbeat: 2007/08/05_01:21:44 info: Link linuxone.com:eth1 up.
heartbeat: 2007/08/05_01:23:43 WARN: node linuxtwo.com: is dead
heartbeat: 2007/08/05_01:23:43 info: Local status now set to: 'active'
heartbeat: 2007/08/05_01:23:43 info: Starting child client "/usr/lib/heartbeat/ipfail" (500,0)
heartbeat: 2007/08/05_01:23:43 WARN: No STONITH device configured.
heartbeat: 2007/08/05_01:23:44 WARN: Shared disks are not protected.
heartbeat: 2007/08/05_01:23:44 info: Resources being acquired from linuxtwo.com.
heartbeat: 2007/08/05_01:23:44 info: Starting "/usr/lib/heartbeat/ipfail" as uid 500  gid 0 (pid 24289)
harc:    2007/08/05_01:23:44 info: Running /etc/ha.d/rc.d/status status
mach_down:       2007/08/05_01:23:44 info: /usr/lib/heartbeat/mach_down: nice_failback: foreign resources acquired
heartbeat: 2007/08/05_01:23:44 info: mach_down takeover complete.
heartbeat: 2007/08/05_01:23:44 info: Initial resource acquisition complete (mach_down)
mach_down:       2007/08/05_01:23:44 info: mach_down takeover complete for node linuxtwo.com.
heartbeat: 2007/08/05_01:23:45 info: Local Resource acquisition completed.
harc:    2007/08/05_01:23:45 info: Running /etc/ha.d/rc.d/ip-request-resp ip-request-resp
ip-request-resp: 2007/08/05_01:23:45 received ip-request-resp 192.168.0.194/25/192.168.0.255 OK yes
ResourceManager: 2007/08/05_01:23:45 info: Acquiring resource group: linuxone.com 192.168.0.194/25/192.168.0.255 httpd
ResourceManager: 2007/08/05_01:23:45 info: Running /etc/ha.d/resource.d/IPaddr 192.168.0.194/25/192.168.0.255 start
IPaddr:  2007/08/05_01:23:46 info: /sbin/ifconfig eth0:0 192.168.0.194  netmask 255.255.255.128  broadcast 192.168.0.25
5
IPaddr:  2007/08/05_01:23:46 info: Sending Gratuitous Arp for 192.168.0.194 on eth0:0
IPaddr:  2007/08/05_01:23:46 /usr/lib/heartbeat/send_arp -i 500 -r 10 -p /var/run/heartbeat/rsctmp/send_arp/send_arp-19
2.168.0.194 eth0 192.168.0.194 auto 192.168.0.194 ffffffffffff
ResourceManager: 2007/08/05_01:23:47 info: Running /etc/ha.d/resource.d/httpd  start
heartbeat: 2007/08/05_01:23:55 info: Local Resource acquisition completed. (none)
heartbeat: 2007/08/05_01:23:55 info: local resource transition completed.

[火星人 ] hearbeat問題,服務無效?已經有572次圍觀

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