- 先configure指定内核路径和安装的路径
- ./configure --with-kernel-dir=/usr/src/kernels/2.6.18-194.el5xen-x86_64/ --prefix=/opt/keepalived/
Keepalived configuration
------------------------
Keepalived version : 1.2.1
Compiler : gcc
Compiler flags : -g -O2 -DETHERTYPE_IPV6=0x86dd
Extra Lib : -lpopt -lssl -lcrypto
Use IPVS Framework : Yes
IPVS sync daemon support : Yes
Use VRRP Framework : YesUse Debug flags : No
- 然后make && make install即可。
主机和备机上都是相同的安装。安装好后先配置好主机上的keepalived.
- tail -f /var/log/messages
Sep 15 09:59:50 free71-171-stable Keepalived_vrrp: VRRP_Instance(test) Transition to MASTER STATE
Sep 15 09:59:50 free71-171-stable Keepalived_vrrp: VRRP_Group(VGM) Syncing instances to MASTER state
Sep 15 09:59:51 free71-171-stable Keepalived_vrrp: VRRP_Instance(test) Entering MASTER STATE
Sep 15 09:59:51 free71-171-stable Keepalived_vrrp: VRRP_Instance(test) setting protocol VIPs.
Sep 15 09:59:51 free71-171-stable Keepalived_vrrp: VRRP_Instance(test) Sending gratuitous ARPs on eth0 for 192.168.3.21
Sep 15 09:59:51 free71-171-stable Keepalived_vrrp: Netlink reflector reports IP 192.168.3.21 added
Sep 15 09:59:51 free71-171-stable Keepalived_healthcheckers: Netlink reflector reports IP 192.168.3.21 added
Sep 15 09:59:56 free71-171-stable Keepalived_vrrp: VRRP_Instance(test) Sending gratuitous ARPs on eth0 for 192.168.3.21
Sep 15 10:00:36 free71-171-stable Keepalived_vrrp: VRRP_Instance(test) Received higher prio advert
Sep 15 10:00:36 free71-171-stable Keepalived_vrrp: VRRP_Instance(test) Entering BACKUP STATE
Sep 15 10:00:36 free71-171-stable Keepalived_vrrp: VRRP_Instance(test) removing protocol VIPs.
Sep 15 10:00:36 free71-171-stable Keepalived_vrrp: VRRP_Group(VGM) Syncing instances to BACKUP state
Sep 15 10:00:36 free71-171-stable Keepalived_vrrp: Netlink reflector reports IP 192.168.3.21 removed
Sep 15 10:00:36 free71-171-stable Keepalived_healthcheckers: Netlink reflector reports IP 192.168.3.21 removed
.................