我一直想通过 yum 在 CentOS 6.3 64 位上安装 Heartbeat3.0.5+Pacemaker1.0.12 。看似安装成功,但是启动Heartbeat时出现问题。
我在下面列出了与此问题相关的一些信息。
节点信息
Active : hm5
Standby : hm6
包裹信息
[root@hm5 rpm]# rpm -qa | grep -i heartbeat
heartbeat-libs-3.0.5-1.1.el6.x86_64
heartbeat-3.0.5-1.1.el6.x86_64
[root@hm5 rpm]# rpm -qa | grep -i pacemaker
pacemaker-1.0.11-1.2.el6.x86_64
pacemaker-libs-1.0.11-1.2.el6.x86_64
ha.cf 信息
[root@hm5 rpm]# cat /etc/ha.d/ha.cf
pacemaker on
logfacility local1
debug 1
udpport 694
keepalive 2
warntime 20
deadtime 24
initdead 48
bcast eth1
node hm5
node hm6
watchdog /dev/watchdog
接口信息
[hm5]
eth0 Link encap:Ethernet HWaddr 54:52:00:18:DE:97
inet addr:192.168.122.35 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1791 errors:0 dropped:0 overruns:0 frame:0
TX packets:361 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:121033 (118.1 KiB) TX bytes:58678 (57.3 KiB)
eth1 Link encap:Ethernet HWaddr 54:52:00:6F:E3:74
inet addr:192.168.123.5 Bcast:192.168.123.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1238 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:68171 (66.5 KiB) TX bytes:126 (126.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
[hm6]
[root@hm6 ~]# ifconfig -a
eth0 Link encap:Ethernet HWaddr 54:52:00:40:7D:BE
inet addr:192.168.122.36 Bcast:192.168.122.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1345 errors:0 dropped:0 overruns:0 frame:0
TX packets:49 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:77115 (75.3 KiB) TX bytes:6223 (6.0 KiB)
eth1 Link encap:Ethernet HWaddr 54:52:00:72:DB:F1
inet addr:192.168.123.6 Bcast:192.168.123.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1286 errors:0 dropped:0 overruns:0 frame:0
TX packets:3 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:70729 (69.0 KiB) TX bytes:126 (126.0 b)
lo Link encap:Local Loopback
inet addr:127.0.0.1 Mask:255.0.0.0
UP LOOPBACK RUNNING MTU:16436 Metric:1
RX packets:0 errors:0 dropped:0 overruns:0 frame:0
TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:0 (0.0 b) TX bytes:0 (0.0 b)
Root用户启动Heartbeat后的错误日志
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(udpport,694)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(keepalive,2)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(warntime,20)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(deadtime,24)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(initdead,48)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(bcast,eth1)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(node,hm5)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(node,hm6)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(watchdog,/dev/watchdog)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+hacluster, gid+<null>
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+hacluster, gid+<null>
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+<null>, gid+haclient
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+root, gid+<null>
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: uid+<null>, gid+haclient
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Beginning authentication parsing
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: 16 max authentication methods
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Keyfile opened
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Keyfile perms OK
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: 16 max authentication methods
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Found authentication method [sha1]
Jul 30 19:12:52 hm5 heartbeat: [1448]: info: AUTH: i+1: key + 0x215bf40, auth+0x7fdb7ac89db0, authname+sha1
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Outbound signing method is 1
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Authentication parsing complete [1]
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(cluster,linux-ha)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(hopfudge,1)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(baud,19200)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(auto_failback,legacy)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(hbgenmethod,file)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(realtime,true)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(msgfmt,classic)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(conn_logd_time,60)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(log_badpack,true)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(syslogmsgfmt,true)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(coredumps,true)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(autojoin,none)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(uuidfrom,file)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(compression,zlib)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(compression_threshold,2)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(traditional_compression,no)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(max_rexmit_delay,250)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: Setting max_rexmit_delay to 250 ms
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(record_config_changes,on)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(record_pengine_inputs,on)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(enable_config_writes,on)
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: add_option(memreserve,6500)
Jul 30 19:12:52 hm5 heartbeat: [1448]: WARN: Logging daemon is disabled --enabling logging daemon is recommended
Jul 30 19:12:52 hm5 heartbeat: [1448]: info: **************************
Jul 30 19:12:52 hm5 heartbeat: [1448]: info: Configuration validated. Starting heartbeat 3.0.5
Jul 30 19:12:52 hm5 heartbeat: [1448]: debug: HA configuration OK. Heartbeat starting.
Jul 30 19:12:52 hm5 heartbeat: [1448]: info: Heartbeat Hg Version: node: 7e3a82377fa8c88b4d9ee47e29020d4531f4629a
Jul 30 19:12:52 hm5 heartbeat: [1449]: info: heartbeat: version 3.0.5
Jul 30 19:12:52 hm5 heartbeat: [1449]: info: Heartbeat generation: 1343634035
Jul 30 19:12:52 hm5 heartbeat: [1449]: debug: uuid is:8724b422-87c2-4056-9433-7be507f2efb3
Jul 30 19:12:52 hm5 heartbeat: [1449]: debug: FIFO process pid: 1452
Jul 30 19:12:52 hm5 heartbeat: [1449]: debug: opening bcast eth1 (UDP/IP broadcast)
Jul 30 19:12:52 hm5 heartbeat: [1449]: debug: glib: SO_BINDTODEVICE(r) set for device eth1
Jul 30 19:12:52 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:12:52 hm5 heartbeat: [1452]: debug: pid 1452 locked in memory.
Jul 30 19:12:52 hm5 heartbeat: [1452]: debug: Limiting CPU: 6 CPU seconds every 60000 milliseconds
Jul 30 19:12:53 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:12:54 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:12:55 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:12:56 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:12:57 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:12:58 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:12:59 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:13:00 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:13:01 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:13:02 hm5 heartbeat: [1449]: ERROR: glib: Unable to bind socket (Permission denied). Giving up.
Jul 30 19:13:02 hm5 heartbeat: [1449]: info: glib: UDP Broadcast heartbeat closed on port 694 interface eth1 - Status: 1
Jul 30 19:13:02 hm5 heartbeat: [1449]: ERROR: make_io_childpair: cannot open bcast eth1
Jul 30 19:13:02 hm5 heartbeat: [1449]: debug: Exiting from pid 1449 [rc+4]
Jul 30 19:13:03 hm5 heartbeat: [1452]: CRIT: Emergency Shutdown: Master Control process died.
Jul 30 19:13:03 hm5 heartbeat: [1452]: CRIT: Killing pid 1449 with SIGTERM
Jul 30 19:13:03 hm5 heartbeat: [1452]: CRIT: Emergency Shutdown(MCP dead): Killing ourselves.
Jul 30 19:13:03 hm5 heartbeat: [1452]: debug: Process 1452 processing SIGTERM
Jul 30 19:13:03 hm5 heartbeat: [1452]: debug: Exiting from pid 1452 [rc+15]
主要问题似乎与
Jul 30 19:13:01 hm5 heartbeat: [1449]: ERROR: glib: Error binding socket (Permission denied). Retrying.
Jul 30 19:13:02 hm5 heartbeat: [1449]: info: glib: UDP Broadcast heartbeat closed on port 694 interface eth1 - Status: 1
答案1
好吧,无论如何,让我们尝试一下,根据您提供的信息,我打赌您遇到了 SELinux 策略问题。
如何检查SELinux是否启用?
[root@ragnarok ~]# getenforce
Enforcing
如果命令返回 enforcing,则您的系统正在启用 SELinux 的情况下运行,如果是这种情况,让我们尝试将其置于 Permissive 模式,看看您的问题是否消失。
如何将 SELinux 模式更改为 Permissive?
[root@ragnarok ~]# setenforce 0
[root@ragnarok ~]# getenforce
Permissive
这将一直有效,直到您重新启动为止,所以现在是时候尝试启动失败的服务了。
如果我们幸运的话并且成功了,您可能会遇到以下错误/勘误表:
https://bugzilla.redhat.com/show_bug.cgi?id=809746
您可以检查错误报告者提供的命令,看看结果是否相同。如果是这种情况,似乎自 6 月以来上游已修复该问题,您可能需要更新系统或等到 CentOS 应用修复。
请向我们反馈您的发现。