keepalived配置多实例高可用

2021-07-07 10:24:59 浏览数 (1)

每一段vrrp_instrance都是一个,底下的看起来没什么不同,但是可以配置脚本,让VI_1检测到nginx有问题后,将10.0.0.3下线

代码语言:javascript复制
vrrp_instance VI_1 {
    state MASTER
    interface eth0
    virtual_router_id 51
    priority 150
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.0.0.3/24 dev eth0 label eth0:1
    }
}
vrrp_instance VI_2 {
    state BACKUP
    interface eth0
    virtual_router_id 52
    priority 100
    advert_int 1
    authentication {
        auth_type PASS
        auth_pass 1111
    }
    virtual_ipaddress {
        10.0.0.4/24 dev eth0 label eth0:2
    }
}

0 人点赞