[root@yong ha.d]# ps aux |grep nginx
root 3731 0.0 0.1 5000 632 ? Ss 10:52 0:00 nginx: master process /usr/local/nginx/sbin/nginx -c /usr/local/nginx/conf/nginx.conf
nobody 3732 0.0 0.1 5200 984 ? S 10:52 0:00 nginx: worker process
[root@yong ha.d]# ps aux |grep heartbeat
root 2765 0.3 1.3 6684 6676 ? SLs 10:44 0:01 heartbeat: master control process
root 2770 0.0 1.2 6488 6480 ? SL 10:44 0:00 heartbeat: FIFO reader
root 2771 0.0 1.2 6484 6476 ? SL 10:44 0:00 heartbeat: write: ucast eth1
root 2772 0.0 1.2 6484 6476 ? SL 10:44 0:00 heartbeat: read: ucast eth1
root 2773 0.0 1.2 6484 6476 ? SL 10:44 0:00 heartbeat: write: ping 192.168.11.1
root 2774 0.0 1.2 6484 6476 ? SL 10:44 0:00 heartbeat: read: ping 192.168.11.1
498 2787 0.0 0.2 5380 1488 ? S 10:45 0:00 /usr/lib/heartbeat/ipfail
11、测试1:主上故意禁ping
#iptables -I INPUT -p icmp -j DROP
Windows客户端一直ping 192.168.11.100 ,一直通,禁止ping之后中间会中断一会,之后一直通;
在从上ifconfig查看出现eth1:0,查看nginx进程也有,说明转换到从机器上运行;
[root@web ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:97:C3:EC
inet addr:192.168.20.30 Bcast:192.168.20.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe97:c3ec/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:460 errors:0 dropped:0 overruns:0 frame:0
TX packets:469 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:37104 (36.2 KiB) TX bytes:101866 (99.4 KiB)
Interrupt:19 Base address:0x2000
eth1 Link encap:Ethernet HWaddr 00:0C:29:97:C3:F6
inet addr:192.168.11.30 Bcast:192.168.11.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fe97:c3f6/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:1022 errors:0 dropped:0 overruns:0 frame:0
TX packets:1035 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:191275 (186.7 KiB) TX bytes:182393 (178.1 KiB)
Interrupt:18 Base address:0x2080
eth1:0 Link encap:Ethernet HWaddr 00:0C:29:97:C3:F6
inet addr:192.168.11.100 Bcast:192.168.11.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:18 Base address:0x2080
12、测试2:主上停止heartbeat服务
1 #service heartbeat stop