我需要你的帮助。我的keepalived无法绑定到vip,我找不到任何错误。这是我的/var/log/message日志。顺便说一下,我使用Centos6.5
[vagrant@director1 ~]$ sudo tail /var/log/messages
May 26 09:35:53 director1 Keepalived_vrrp[14272]: Registering gratuitous ARP shared channel
May 26 09:35:53 director1 Keepalived_vrrp[14272]: Opening file '/etc/keepalived/keepalived.conf'.
May 26 09:35:53 director1 Keepalived_vrrp[14273]: Netlink reflector reports IP 10.0.2.15 added
May 26 09:35:53 director1 Keepalived_vrrp[14273]: Netlink reflector reports IP 192.168.1.104 added
May 26 09:35:53 director1 Keepalived_vrrp[14273]: Netlink reflector reports IP fe80::a00:27ff:fec7:8f23 added
May 26 09:35:53 director1 Keepalived_vrrp[14273]: Netlink reflector reports IP fe80::a00:27ff:fe55:b1cd added
May 26 09:35:53 director1 Keepalived_vrrp[14273]: Registering Kernel netlink reflector
May 26 09:35:53 director1 Keepalived_vrrp[14273]: Registering Kernel netlink command channel
May 26 09:35:53 director1 Keepalived_vrrp[14273]: Registering gratuitous ARP shared channel
May 26 09:35:53 director1 Keepalived_vrrp[14273]: Opening file '/etc/keepalived/keepalived.conf'.
[vagrant@director1 ~]$ sudo tail /var/log/messages
May 26 09:35:57 director1 Keepalived_vrrp[15242]: Opening file '/etc/keepalived/keepalived.conf'.
May 26 09:35:57 director1 Keepalived[24939]: VRRP child process(15242) died: Respawning
May 26 09:35:57 director1 Keepalived[24939]: Starting VRRP child process, pid=15243
May 26 09:35:57 director1 Keepalived_vrrp[15243]: Netlink reflector reports IP 10.0.2.15 added
May 26 09:35:57 director1 Keepalived_vrrp[15243]: Netlink reflector reports IP 192.168.1.104 added
May 26 09:35:57 director1 Keepalived_vrrp[15243]: Netlink reflector reports IP fe80::a00:27ff:fec7:8f23 added
May 26 09:35:57 director1 Keepalived_vrrp[15243]: Netlink reflector reports IP fe80::a00:27ff:fe55:b1cd added
May 26 09:35:57 director1 Keepalived_vrrp[15243]: Registering Kernel netlink reflector
May 26 09:35:57 director1 Keepalived_vrrp[15243]: Registering Kernel netlink command channel
May 26 09:35:57 director1 Keepalived_vrrp[15243]: Registering gratuitous ARP shared channel
最糟糕的是它总是打印这个,我不知道发生了什么事。
这是我的 keepalived.conf,它位于 /etc/keepalived/keepalived.conf
! Configuration File for keepalived
global_defs {
notification_email {
[email protected]
}
notification_email_from Keepalived@localhost
smtp_server 127.0.0.1
smtp_connect_timeout 30
router_id LVS_DEVEL
}
vrrp_sync_group G1{
group{
VI_1
}
}
vrrp_instance VI_1 {
state MASTER
interface eth1
virtual_router_id 51
priority 100
advert_int 1
smtp_alert
authentication {
auth_type PASS
auth_pass baidu
}
virtual_ipaddress {
192.168.1.99/24 dev eth1 label eth1:0
}
}
多谢。
这是我的“ip a”输出。
1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue state UNKNOWN
link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00
inet 127.0.0.1/8 scope host lo
inet6 ::1/128 scope host
valid_lft forever preferred_lft forever
2: eth0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:c7:8f:23 brd ff:ff:ff:ff:ff:ff
inet 10.0.2.15/24 brd 10.0.2.255 scope global eth0
inet6 fe80::a00:27ff:fec7:8f23/64 scope link
valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast state UP qlen 1000
link/ether 08:00:27:55:b1:cd brd ff:ff:ff:ff:ff:ff
inet 192.168.1.104/24 brd 192.168.1.255 scope global eth1
inet6 fe80::a00:27ff:fe55:b1cd/64 scope link
valid_lft forever preferred_lft forever
答案1
我做了实验,发现你的配置只有在删除此部分时才会启动:
vrrp_sync_group G1{
group{
VI_1
}
}
如果您想启动keepalived
那就足够了,但是它无法启动的原因还需要进一步调查。