无法使用KeepAlive和VRRP设置浮动IP
我有一台ubuntu机器,上面有两个虚拟机,每个虚拟机运行一个应用程序,我需要为它们提供高可用性,所以我使用Keepalive和VRRP实现了一个浮动IP,但我无法使用虚拟IP从主机ping主虚拟机,它说目标主机无法访问 VM1的keepalived.conf:无法使用KeepAlive和VRRP设置浮动IP,ip,high-availability,virtual-ip-address,keepalived,Ip,High Availability,Virtual Ip Address,Keepalived,我有一台ubuntu机器,上面有两个虚拟机,每个虚拟机运行一个应用程序,我需要为它们提供高可用性,所以我使用Keepalive和VRRP实现了一个浮动IP,但我无法使用虚拟IP从主机ping主虚拟机,它说目标主机无法访问 VM1的keepalived.conf: vrrp_instance VI_1 { interface enp1s0 state MASTER #BACKUP here for VM2 virtual_router_
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
~