启动heartbeat 时 ,发现 没有heartbeat 进程,查看日志发现提示说glib权限被拒绝了,
网上搜了一下,发现是selinux 搞的鬼
tac /var/log/ha-log
heartbeat[30710]: 2013/09/12_19:30:06 ERROR: glib: Error binding socket (Permission denied). Retrying.
解决方法:
1、关闭linux防火墙或者开放694端口
2、 执行一下命令,把selinux改为宽大模式
[root@master local]# getenforce
[root@master local]# setenforce 0
[root@master local]# getenforce
Permissive
[root@slave ~]# vim /etc/selinux/config
# This file controls the state of SELinux on the system.
# SELINUX= can take one of these three values:
# enforcing - SELinux security policy is enforced.
# permissive - SELinux prints warnings instead of enforcing.
# disabled - No SELinux policy is loaded.
SELINUX=Permissive
# SELINUXTYPE= can take one of these two values:
# targeted - Targeted processes are protected,
# mls - Multi Level Security protection.
SELINUXTYPE=targeted
3、[root@master local]# service heartbeat start
[root@master local]# ps -ef |grep heart
root 1767 2521 0 20:27 pts/1 00:00:00 grep heart
root 31328 1 0 20:17 ? 00:00:00 heartbeat: master control process
nobody 31332 31328 0 20:17 ? 00:00:00 heartbeat: FIFO reader
nobody 31333 31328 0 20:17 ? 00:00:00 heartbeat: write: bcast eth0
nobody 31334 31328 0 20:17 ? 00:00:00 heartbeat: read: bcast eth0
nobody 31335 31328 0 20:17 ? 00:00:00 heartbeat: write: ping 192.168.10.254
nobody 31336 31328 0 20:17 ? 00:00:00 heartbeat: read: ping 192.168.10.254
[root@master local]# netstat -anp|grep 694
udp 0 0 0.0.0.0:694 0.0.0.0:* 31333/heartbeat: wr
[root@master local]#
[root@slave ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:FA:0F:BD
inet addr:192.168.10.98 Bcast:192.168.10.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fefa:fbd/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:255876 errors:0 dropped:0 overruns:0 frame:0
TX packets:115254 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:374349475 (357.0 MiB) TX bytes:8163536 (7.7 MiB)
Interrupt:18 Base address:0x2000
eth0:0 Link encap:Ethernet HWaddr 00:0C:29:FA:0F:BD
inet addr:192.168.10.95 Bcast:192.168.10.255 Mask:255.255.255.0 #vip
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:18 Base address:0x2000
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:4 errors:0 dropped:0 overruns:0 frame:0
TX packets:4 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:240 (240.0 b) TX bytes:240 (240.0 b)
[root@slave ~]#
启动成功