Configuration

keepalived綁定不了vip沒有報錯

  • May 27, 2017

我需要你的幫助。我的 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 {
   willcream@126.com

 }
  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

我做了實驗室,發現您的配置僅在刪除此部分時才開始:

vrrp_sync_group G1{
   group{
       VI_1
   }
}

如果您想啟動就keepalived足夠了,但需要額外調查為什麼它不啟動。

引用自:https://serverfault.com/questions/852399