[root@node2 ~]# service heartbeat start node2配置完了后启动heartbeat服务
Starting High-Availability services:
2009/04/25_07:28:23 INFO: Resource is stopped
[ OK ]
[root@node2 ~]# ifconfig 此时并没有出现虚拟IP
eth0 Link encap:Ethernet HWaddr 00:0C:29:FB:D3:B5
inet addr:192.168.254.237 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fefb:d3b5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:21934 errors:0 dropped:0 overruns:0 frame:0
TX packets:2669 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2195508 (2.0 MiB) TX bytes:383855 (374.8 KiB)
Interrupt:59 Base address:0x2080
eth1 Link encap:Ethernet HWaddr 00:0C:29:FB:D3:AB
inet addr:192.168.211.131 Bcast:192.168.211.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fefb:d3ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:12478 errors:0 dropped:0 overruns:0 frame:0
TX packets:12901 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:2036369 (1.9 MiB) TX bytes:2261217 (2.1 MiB)
Interrupt:59 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:6408 errors:0 dropped:0 overruns:0 frame:0
TX packets:6408 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9340926 (8.9 MiB) TX bytes:9340926 (8.9 MiB)
[root@node1 ~]# service heartbeat stop 关闭下node1的heartbeat服务
Stopping High-Availability services:
[ OK ]
[root@node2 ~]# ifconfig 过几秒,就可以看到虚拟IP转到node2上了
eth0 Link encap:Ethernet HWaddr 00:0C:29:FB:D3:B5
inet addr:192.168.254.237 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fefb:d3b5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19181 errors:0 dropped:0 overruns:0 frame:0
TX packets:1851 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1922795 (1.8 MiB) TX bytes:235874 (230.3 KiB)
Interrupt:59 Base address:0x2080
eth0:0 Link encap:Ethernet HWaddr 00:0C:29:FB:D3:B5
inet addr:192.168.254.88 Bcast:192.168.254.255 Mask:255.255.255.0
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
Interrupt:59 Base address:0x2080
eth1 Link encap:Ethernet HWaddr 00:0C:29:FB:D3:AB
inet addr:192.168.211.131 Bcast:192.168.211.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fefb:d3ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:10677 errors:0 dropped:0 overruns:0 frame:0
TX packets:10426 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1732733 (1.6 MiB) TX bytes:1807937 (1.7 MiB)
Interrupt:59 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:6408 errors:0 dropped:0 overruns:0 frame:0
TX packets:6408 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9340926 (8.9 MiB) TX bytes:9340926 (8.9 MiB)
[root@node1 ~]# service heartbeat start node1再次启动heartbeat服务后,IP将转回node1
Starting High-Availability services:
2009/04/24_09:41:02 INFO: Resource is stopped
[ OK ]
[root@node2 ~]# ifconfig
eth0 Link encap:Ethernet HWaddr 00:0C:29:FB:D3:B5
inet addr:192.168.254.237 Bcast:192.168.254.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fefb:d3b5/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:19615 errors:0 dropped:0 overruns:0 frame:0
TX packets:1990 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1965694 (1.8 MiB) TX bytes:260841 (254.7 KiB)
Interrupt:59 Base address:0x2080
eth1 Link encap:Ethernet HWaddr 00:0C:29:FB:D3:AB
inet addr:192.168.211.131 Bcast:192.168.211.255 Mask:255.255.255.0
inet6 addr: fe80::20c:29ff:fefb:d3ab/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1
RX packets:11003 errors:0 dropped:0 overruns:0 frame:0
TX packets:10859 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:1786706 (1.7 MiB) TX bytes:1888112 (1.8 MiB)
Interrupt:59 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:6408 errors:0 dropped:0 overruns:0 frame:0
TX packets:6408 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:0
RX bytes:9340926 (8.9 MiB) TX bytes:9340926 (8.9 MiB)
[root@node1 ~]# cat /var/log/ha-log 更详细的信息可以查看相应的日志