Keepalived-出现双ip问题
问题
可能是上联交换机禁用了arp的广播限制,造成keepalive无法通过广播通信,两台服务器抢占vip,出现同时都有vip的情况
解决过程
1 2 3 4 5 6 7 8 9
| tcpdump -i eth0 vrrp -n
tcpdump -i eth0 vrrp -n
|
主机配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| ! Configuration File for keepalived
global_defs { router_id NGINX }
vrrp_instance VI_1 { state MASTER interface eth0 virtual_router_id 17
unicast_src_ip 10.77.114.150 unicast_peer { 10.77.114.151 } priority 150 advert_int 1 authentication { auth_type PASS auth_pass hykj } virtual_ipaddress { 10.77.114.130 } }
|
备机配置
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25
| ! Configuration File for keepalived
global_defs { router_id NGINX }
vrrp_instance VI_1 { state BACKUP interface eth0 virtual_router_id 17
unicast_src_ip 10.77.114.151 unicast_peer { 10.77.114.150 } priority 99 advert_int 1 authentication { auth_type PASS auth_pass hykj } virtual_ipaddress { 10.77.114.130 } }
|
keepalived 安装
1
| yum install -y keepalived
|
老年佛系运维 | biglovewheat@126.com