keepalived默认情况下使用的多播模式,在多keepalived或keepalived跨网段环境中容易产生脑裂等故障。针对这种情况,可以更改为单播模式,配置例子如下:

vrrp_instance VI_1 {
    state BACKUP       
    interface eth0
    virtual_router_id 41
    priority 100
    advert_int 1
    nopreempt
    unicast_src_ip 10.8.100.1
    unicast_peer {
        10.8.90.1
    }
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    track_script {
        check_nginx
    }
    virtual_ipaddress {
        10.8.99.1
    }
}

1 对 “多keepalived或keepalived跨网段环境中使用单播模式”的想法;

发表评论

电子邮件地址不会被公开。 必填项已用*标注