keepavlied 虚拟IP未启动

查看VIP

ip addr |grep 10.8.8.100
未显示 VIP信息。

查看运行状态信息

错误如下:

-> # systemctl status keepalived
● keepalived.service - LVS and VRRP High Availability Monitor
    Loaded: loaded (/usr/lib/systemd/system/keepalived.service; enabled; vendor preset: disabled)
   Active: active (running) since Mon 2022-03-14 14:55:58 CST; 6min ago
 Main PID: 18772 (keepalived)
   CGroup: /system.slice/keepalived.service
           ├─18772 /usr/sbin/keepalived -D
           ├─18773 /usr/sbin/keepalived -D
           └─18774 /usr/sbin/keepalived -D

Mar 14 15:02:17 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: VRRP_Instance(VI_1) ignoring received advertisment...
Mar 14 15:02:18 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: (VI_1): ip address associated with VRID 51 not present in MASTER advert : 10.8.8.100
Mar 14 15:02:18 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: bogus VRRP packet received on bond0 !!!
Mar 14 15:02:18 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: VRRP_Instance(VI_1) ignoring received advertisment...
Mar 14 15:02:19 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: (VI_1): ip address associated with VRID 51 not present in MASTER advert : 10.8.8.100
Mar 14 15:02:19 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: bogus VRRP packet received on bond0 !!!
Mar 14 15:02:19 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: VRRP_Instance(VI_1) ignoring received advertisment...
Mar 14 15:02:20 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: (VI_1): ip address associated with VRID 51 not present in MASTER advert : 10.8.8.100
Mar 14 15:02:20 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: bogus VRRP packet received on bond0 !!!
Mar 14 15:02:20 nm-bigdata-030064135.ctc.local Keepalived_vrrp[18774]: VRRP_Instance(VI_1) ignoring received advertisment...

从上面信息得知:(VI_1): ip address associated with VRID 51 not present in MASTER advert : 10.8.8.100

keepalived

不同的vrrp实例应该具有不同的virtual_router_id值。相同的VRRP实例应该具有相同的值。
virtual_router_id 是区分不同的实例。51被其它的实例占用,取值范围0~255.
您需要在同一群集中的成员上具有相同的值。如果您有另一个群集,其成员应该具有另一个值。Virtual_router_id每个vrrp群集应该是唯一的。

所以只需要将 keepalived.conf配置中的virtual_router_id改成其它值即可。如换成:49.重启即可。

! Configuration File for keepalived

global_defs {
   router_id backup
}

vrrp_script chk_nfs {
    script "/etc/keepalived/nfs-check.sh"
    interval 2
    weight -20
}

vrrp_instance VI_1 {
    state BACKUP
    interface bond0
    virtual_router_id 49
    priority 80
    advert_int 1
    nopreempt  

    authentication {
        auth_type PASS
        auth_pass 1111
    }
    track_script {
         chk_nfs
    }
    virtual_ipaddress {
        10.8.8.100
    }
}

参考

  • https://serverfault.com/questions/473058/keepaliveds-virtual-router-id-should-it-be-unique-per-node

你可能感兴趣的:(keepavlied 虚拟IP未启动)