2131 发表于 2015-3-4 08:17:41

由DHCP引起的Keepalived无法绑定VIP

一 故障描述
我在台湾合作方给定的两台虚拟机上部署HAProxy+Keepalived负载均衡高可用方案。在配置完Keepalived后,重新启动Keepalived,Keepalived没有绑定VIP。


keepalived.conf的内容
LB1 Master

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
! Configuration File for keepalived

global_defs {
   notification_email {
   admin@example.com
   }
   notification_email_from lb1@example.com
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
   router_id LB1_MASTER
}

vrrp_script chk_haproxy {
      script "killall -0 haproxy"
      interval 2
    weight 2
    }




vrrp_instance VI_1 {
    state MASTER
    interface eth1
    virtual_router_id 51
    priority 100
    advert_int 1
    authentication {
      auth_type PASS
      auth_pass 1111
    }
    virtual_ipaddress {

   10.1.1.200/24      brd 10.1.1.255      dev eth1 label eth1:vip

    }

    track_script {
      chk_haproxy
               }
}





重新启动Keepalived查看日志

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
Mar3 18:09:00 cv00300005248-1 Keepalived: Stopping Keepalived v1.2.15 (02/28,2015)
Mar3 18:09:00 cv00300005248-1 Keepalived: Starting Keepalived v1.2.15 (02/28,2015)
Mar3 18:09:00 cv00300005248-1 Keepalived: Starting Healthcheck child process, pid=20261
Mar3 18:09:00 cv00300005248-1 Keepalived: Starting VRRP child process, pid=20262
Mar3 18:09:00 cv00300005248-1 Keepalived_vrrp: Registering Kernel netlink reflector
Mar3 18:09:00 cv00300005248-1 Keepalived_vrrp: Registering Kernel netlink command channel
Mar3 18:09:00 cv00300005248-1 Keepalived_vrrp: Registering gratuitous ARP shared channel
Mar3 18:09:00 cv00300005248-1 Keepalived_healthcheckers: Registering Kernel netlink reflector
Mar3 18:09:00 cv00300005248-1 Keepalived_healthcheckers: Registering Kernel netlink command channel
Mar3 18:09:00 cv00300005248-1 Keepalived_healthcheckers: Configuration is using : 3924 Bytes
Mar3 18:09:00 cv00300005248-1 Keepalived_healthcheckers: Using LinkWatch kernel netlink reflector...
Mar3 18:09:00 cv00300005248-1 Keepalived_vrrp: Configuration is using : 55712 Bytes
Mar3 18:09:00 cv00300005248-1 Keepalived_vrrp: Using LinkWatch kernel netlink reflector...
Mar3 18:09:18 cv00300005248-1 kernel: __ratelimit: 1964 callbacks suppressed
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.
Mar3 18:09:18 cv00300005248-1 kernel: Neighbour table overflow.





查看VIP绑定情况

1
2
3
4
$ ifconfig eth1:ha
eth1:ha   Link encap:EthernetHWaddr 00:16:3E:F2:37:6B
          UP BROADCAST RUNNING MULTICASTMTU:1500Metric:1
          Interrupt:13




没有VIP绑定

二 排查过程

1)检查VIP的配置情况
向合作方确认提供的VIP的详细情况

IPADDR   10.1.1.200
NETMASK   255.255.255.0
GATEWAY   10.1.1.1
Brodcast10.1.1.255


页: [1]
查看完整版本: 由DHCP引起的Keepalived无法绑定VIP