参照http://xinfly.blog.51cto.com/blog/6252752/1194110
配置Linux双机热备之Heartheat,启动Ok!
[root@drbd02 ~]# /etc/init.d/heartbeat start
Starting High-Availability services:
2013/05/03_23:13:28 INFO: Resource is stopped
[确定]
[root@drbd02 ~]#
后因各种原因,修改了主机名,最近要用到Heartheat做测试,rpm查看了一下,各种包都有,果断的restart!
heartbeat[16379]: 2013/05/06_14:49:37 info: Version 2 support: false
heartbeat[16379]: 2013/05/06_14:49:37 ERROR: Current node [drbd01] not in configuration!
heartbeat[16379]: 2013/05/06_14:49:37 info: By default, cluster nodes are named by `uname -n` and must be declared with a 'node' directive in the ha.cf file.
heartbeat[16379]: 2013/05/06_14:49:37 info: See also: http://linux-ha.org/ha.cf/NodeDirective
heartbeat[16379]: 2013/05/06_14:49:37 WARN: Logging daemon is disabled --enabling logging daemon is recommended
heartbeat[16379]: 2013/05/06_14:49:37 ERROR: Configuration error, heartbeat not started.
看到第二行喽 ERROR: Current node [drbd01] not in configuration! 当前节点没有配置
配置文件各种找,功夫不负有心人,在ha.cf配置文件的214、215行找到了当时配置的两个节点
214 node ha01
215 node ha02
果断改成当前的主机名,restart!又没成功
heartbeat[17219]: 2013/05/06_15:05:31 info: Version 2 support: false
heartbeat[17219]: 2013/05/06_15:05:31 WARN: Logging daemon is disabled --enabling logging daemon is recommended
heartbeat[17219]: 2013/05/06_15:05:31 info: **************************
heartbeat[17219]: 2013/05/06_15:05:31 info: Configuration validated. Starting heartbeat 2.1.3
heartbeat[17219]: 2013/05/06_15:05:31 ERROR: Bad nodename in /etc/ha.d/haresources [ha01]
heartbeat[17219]: 2013/05/06_15:05:31 ERROR: Configuration error, heartbeat not started.
问题出来了 ERROR: Bad nodename in /etc/ha.d/haresources [ha01]!太不认真了!改之。。。
[root@drbd01 ~]# vim /etc/ha.d/haresources
151 drbd01 192.168.0.200 httpd
restart。。。
[root@drbd01 ~]# /etc/init.d/heartbeat restart
Stopping High-Availability services:
[确定]
Waiting to allow resource takeover to complete:
[确定]
Starting High-Availability services:
2013/05/06_15:07:40 INFO: Resource is stopped
[确定]
[root@drbd01 ~]# /etc/init.d/heartbeat status
heartbeat OK [pid 17379 et al] is running on drbd01 [drbd01]...
仅以此献给那些跟我犯一样低级错误的同僚们!