keepalived 实现热备
基本环境
MASTER机,10.0.0.9
BACKUP机,10.0.0.10
1,安装
[root@davidserver ~]# ifconfigeth0 Link encap:Ethernet HWaddr 00:50:56:20:3D:2A inet addr:10.0.0.9 Bcast:10.0.0.255 Mask:255.255.255.0 inet6 addr: fe80::250:56ff:fe20:3d2a/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:1206 errors:0 dropped:0 overruns:0 frame:0 TX packets:1282 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:125352 (122.4 KiB) TX bytes:148912 (145.4 KiB)eth0:0 Link encap:Ethernet HWaddr 00:50:56:20:3D:2A inet addr:10.0.0.100 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1eth0:1 Link encap:Ethernet HWaddr 00:50:56:20:3D:2A inet addr:10.0.0.101 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1eth1 Link encap:Ethernet HWaddr 00:50:56:34:80:48 inet addr:192.168.0.9 Bcast:192.168.0.255 Mask:255.255.0.0 inet6 addr: fe80::250:56ff:fe34:8048/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX packets:349754 errors:0 dropped:0 overruns:0 frame:0 TX packets:476 errors:0 dropped:0 overruns:0 carrier:0 collisions:0 txqueuelen:1000 RX bytes:21502934 (20.5 MiB) TX bytes:32269 (31.5 KiB)eth1:0 Link encap:Ethernet HWaddr 00:50:56:34:80:48 inet addr:192.168.0.100 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1eth1:1 Link encap:Ethernet HWaddr 00:50:56:34:80:48 inet addr:192.168.0.101 Bcast:0.0.0.0 Mask:255.255.255.255 UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1lo 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: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)