2

我有一台托管两个虚拟机的 ubuntu 机器,每个虚拟机都运行一个应用程序,我需要为其提供高可用性,所以我使用 keepalived 和 VRRP 实现了一个浮动 IP,但我无法使用虚拟 IP ping 主虚拟机主机,它说目标主机不可达。

VM1 的 keepalived.conf:

vrrp_instance VI_1 { 
    interface enp1s0 
    state MASTER                  #BACKUP here for VM2
    virtual_router_id 51 
    priority 200                  #100 in case of VM2
    advert_int 2 
    authentication { 
        auth_type PASS
        auth_pass monkey 
    } 
    virtual_ipaddress { 
        192.168.122.150/24
    }
}

当我启动 keepalived 服务时,它显示以下消息:

Dec 19 14:31:37 secondaryvm Keepalived_vrrp[1419]: Unknown keyword '}'
Dec 19 14:31:37 secondaryvm Keepalived_vrrp[1419]: Unknown keyword 'virtual_ipaddress'
Dec 19 14:31:37 secondaryvm Keepalived_vrrp[1419]: Unknown keyword '192.168.122.150'
Dec 19 14:31:37 secondaryvm Keepalived_vrrp[1419]: Unknown keyword '}'
Dec 19 14:31:37 secondaryvm Keepalived_vrrp[1419]: Unknown keyword '}'
Dec 19 14:31:37 secondaryvm Keepalived_vrrp[1419]: Using LinkWatch kernel netlink reflector...
Dec 19 14:31:37 secondaryvm systemd[1]: Started Keepalive Daemon (LVS and VRRP).
Dec 19 14:31:39 secondaryvm Keepalived_vrrp[1419]: VRRP_Instance(VI_1) Transition to MASTER STATE
Dec 19 14:31:41 secondaryvm Keepalived_vrrp[1419]: VRRP_Instance(VI_1) Entering MASTER STATE
Dec 20 01:55:40 secondaryvm Keepalived_vrrp[1419]: VRRP_Instance(VI_1) Received advert with lower priori
~
4

1 回答 1

0

回答有点晚了,但我自己也遇到了类似的问题。我一直收到一条错误消息,说“vrrp_track_process”是一个未知关键字,即使在 1 个 VM 而不是其他 VM 上工作也是如此。在查看“man keepalived.conf”时,我注意到一个虚拟机的文档中有“vrrp_track_process”,而另一个没有。因此需要更新包/仓库。很可能当前安装的软件包版本不支持使用的关键字。

于 2021-07-13T13:35:21.790 回答