Keepalived_FAQ_one or more VIP associated with VRID mismatch actual MASTER advert

注意: 同一网段中virtual_router_id的值不能重复,否则会出错,相关错误信息如下。 

 

Keepalived_vrrp[27120]: ip address associated with VRIDnot present in received packet :

one or more VIP associated with VRID mismatch actualMASTER advert

bogus VRRP packet received on eth1 !!!

receive an invalid ip number count associated with VRID!

VRRP_Instance(xxx) ignoring received advertisment...

 

可以用这条命令来查看该网络中所存在的vrid:tcpdump -nn -i any net 224.0.0.0/8

同一个局域网内的VRRP协议的VRID值不能相同,否则无法完成主备切换

但同一集群的keepalived的主、备机的virtual_router_id 必须相同

 

修改keepalived配置文件中的virtual_router_id,因为同一集群的keepalived的主、备机的virtual_router_id必须相同,取值0-255 但是同一内网中不应有相同virtual_router_id的集群。

 

 

[root@node120 keepalived]# tcpdump -nn -i any net224.0.0.0/8

tcpdump: verbose output suppressed, use -v or -vv forfull protocol decode

listening on any, link-type LINUX_SLL (Linux cooked),capture size 65535 bytes

16:14:25.191744 IP 192.168.2.110 > 224.0.0.18: VRRPv2,Advertisement, vrid 51, prio 150, authtype simple, intvl 1s, length 20

16:14:25.193451 IP 192.168.3.146 > 224.0.0.18: VRRPv2,Advertisement, vrid 54, prio 120, authtype simple, intvl 1s, length 20

16:14:25.193902 IP 192.168.3.144 > 224.0.0.18: VRRPv2,Advertisement, vrid 52, prio 120, authtype simple, intvl 1s, length 20

16:14:26.192318 IP 192.168.2.110 > 224.0.0.18: VRRPv2,Advertisement, vrid 51, prio 150, authtype simple, intvl 1s, length 20

16:14:26.194179 IP 192.168.3.146 > 224.0.0.18: VRRPv2,Advertisement, vrid 54, prio 120, authtype simple, intvl 1s, length 20

16:14:26.194193 IP 192.168.3.144 > 224.0.0.18: VRRPv2,Advertisement, vrid 52, prio 120, authtype simple, intvl 1s, length 20

16:14:27.192902 IP 192.168.2.110 > 224.0.0.18: VRRPv2,Advertisement, vrid 51, prio 150, authtype simple, intvl 1s, length 20

16:14:27.194601 IP 192.168.3.146 > 224.0.0.18: VRRPv2,Advertisement, vrid 54, prio 120, authtype simple, intvl 1s, length 20

16:14:27.194848 IP 192.168.3.144 > 224.0.0.18: VRRPv2,Advertisement, vrid 52, prio 120, authtype simple, intvl 1s, length 20

16:14:28.193543 IP 192.168.2.110 > 224.0.0.18: VRRPv2,Advertisement, vrid 51, prio 150, authtype simple, intvl 1s, length 20

16:14:28.195130 IP 192.168.3.144 > 224.0.0.18: VRRPv2,Advertisement, vrid 52, prio 120, authtype simple, intvl 1s, length 20

16:14:28.195143 IP 192.168.3.146 > 224.0.0.18: VRRPv2,Advertisement, vrid 54, prio 120, authtype simple, intvl 1s, length 20

 

 

  priority 用来选举master的,要成为master,那么这个选项的值最好高于其他机器50个点,该项取值范围是1-255(在此范围之外会被识别成默认值100)。

 

    advert_int 发VRRP包的时间间隔,即多久进行一次master选举(可以认为是健康查检时间间隔)。

 

   authentication 认证区域,认证类型有PASS和HA(IPSEC),推荐使用PASS(密码只识别前8位)。

 

   virtual_ipaddress vip,不解释了。

 

   virtual_routes 虚拟路由,当IP漂过来之后需要添加的路由信息。

 

   virtual_ipaddress_excluded 发送的VRRP包里不包含的IP地址,为减少回应VRRP包的个数。在网卡上绑定的IP地址比较多的时候用。

 

    nopreempt 允许一个priority比较低的节点作为master,即使有priority更高的节点启动。

 

首先nopreemt必须在state为BACKUP的节点上才生效(因为是BACKUP节点决定是否来成为MASTER的),其次要实现类似于关闭autofailback的功能需要将所有节点的state都设置为BACKUP,或者将master节点的priority设置的比BACKUP低。我个人推荐使用将所有节点的state都设置成BACKUP并且都加上nopreempt选项,这样就完成了关于autofailback功能,当想手动将某节点切换为MASTER时只需去掉该节点的nopreempt选项并且将priority改的比其他节点大,然后重新加载配置文件即可(等MASTER切过来之后再将配置文件改回去再reload一下)。

 

当使用track_script时可以不用加nopreempt,只需要加上preempt_delay 5,这里的间隔时间要大于vrrp_script中定义的时长。

 

   preempt_delay master启动多久之后进行接管资源(VIP/Route信息等),并提是没有nopreempt选项。

 

YWSOS.COM 平台代运维解决方案
 评论
 发表评论
姓   名:

Powered by AKCMS