我在两台 Linux 服务器(Ubuntu 14.04)上安装了 keepalived Konifg 文件:
! ConfigFile for keepalived
global_defs{
vrrp_instance VI_1 {
state MASTER
interface eth0
virtual_router_id 51
priority 110
advert_int 1
}
virtual_ipaddress {
192.168.178.16
}
}
两台服务器可以相互通信,但在系统日志中显示,接口队列为空:
Jan 5 13:54:06 Linux01 Keepalived_healthcheckers[1016]: Interface queue is empty
Jan 5 13:54:06 Linux01 Keepalived_healthcheckers[1016]: Registering Kernel netl
ink reflector
Jan 5 13:54:06 Linux01 Keepalived_healthcheckers[1016]: Registering Kernel netl
ink command channel
Jan 5 13:54:06 Linux01 Keepalived_vrrp[1017]: Opening file '/etc/keepalived/kee
palived.conf'.
Jan 5 13:54:06 Linux01 Keepalived_vrrp[1017]: Configuration is using : 57962 By
tes
Jan 5 13:54:06 Linux01 Keepalived_vrrp[1017]: Using LinkWatch kernel netlink re
flector...
Jan 5 13:54:06 Linux01 Keepalived_healthcheckers[1016]: Opening file '/etc/keep
alived/keepalived.conf'.
Jan 5 13:54:06 Linux01 Keepalived_healthcheckers[1016]: Configuration is using
: 4421 Bytes
Jan 5 13:54:06 Linux01 Keepalived_healthcheckers[1016]: Using LinkWatch kernel
netlink reflector...
Jan 5 13:54:07 Linux01 Keepalived_vrrp[1017]: VRRP_Instance(VI_1) Transition to
MASTER STATE
我无法 ping 通虚拟 IP。
谢谢
答案1
我解决了我的问题:
我的语法有误。global_defs 不应覆盖其他配置。virtual_ipaddress{} 应位于 vrrp_instance 配置标记中。