Keepalived 出現VIP 無法綁定的情況


安裝有keepalived的兩台MySQL服務器做高可用:
OS版本:Red Hat Enterprise Linux Server release 6.3 (Santiago)
MySQL版本:5.7.19-17-log Percona Server
服務器:10.95.109.174/173
設定VIP:10.95.109.171。

一.現象

啟動10.95.109.174的keepalived服務,服務啟動正常,VIP 無法綁定
啟動10.95.109.173的keepalived服務,服務啟動正常,VIP 無法綁定

二.問題原因

1.查看日志

查看10.95.109.174的日志發現,其上keepalived服務無法獲得VIP;

Dec 11 14:17:05 lspprddb514 Keepalived_vrrp[15214]: VRRP_Instance(VI_1) ignoring received advertisment...
Dec 11 14:17:06 lspprddb514 Keepalived_vrrp[15214]: ip address associated with VRID not present in received packet : 10.95.109.171
Dec 11 14:17:06 lspprddb514 Keepalived_vrrp[15214]: one or more VIP associated with VRID mismatch actual MASTER advert
Dec 11 14:17:06 lspprddb514 Keepalived_vrrp[15214]: bogus VRRP packet received on eth0 !!!

2.檢查VRID 是否沖突

采用tcpdump抓包檢查VRID 是否沖突
[root@lspprddb514 ~]# tcpdump -i eth0 vrrp -n |grep 174
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes
14:27:48.344605 IP 10.95.109.81 > 224.0.0.18: VRRPv2, Advertisement, vrid 174, prio 150, authtype simple, intvl 1s, length 20
14:27:49.344645 IP 10.95.109.81 > 224.0.0.18: VRRPv2, Advertisement, vrid 174, prio 150, authtype simple, intvl 1s, length 20
14:27:50.344723 IP 10.95.109.81 > 224.0.0.18: VRRPv2, Advertisement, vrid 174, prio 150, authtype simple, intvl 1s, length 20
14:27:51.344882 IP 10.95.109.81 > 224.0.0.18: VRRPv2, Advertisement, vrid 174, prio 150, authtype simple, intvl 1s, length 20

顯然,10.95.109.174所配置的 vrid 已經有其他數據庫使用了。

三.解決

修改vrid 沖突的其中一套庫的 vrid 即可

vrrp_instance VI_1 {
	state BACKUP
    interface eth0
    virtual_router_id 174
    priority 150
    advert_int 1
    #mcast_src_ip 10.19.90.212
    authentication {
        auth_type PASS
        auth_pass 1111
}


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM