[CentOS] Keepalive...

John Doe

jdmls at yahoo.com
Fri Feb 20 14:58:06 UTC 2009


Hi,

I've been trying to setup keepalive (vrrp) with LVS in direct routing on Centos 5 and I am stuck...
Installed ipvsadm from the repo (had to touch /etc/sysconfig/ipvsadm because it complained it was missing)
Compiled keepalived-1.1.16.tar.gz

Test setup:

             main switch (192.168.16.0/20)
                                     |
             eth0: 192.168.28.[226|227]
                   VIP=192.168.16.123
                2 lvs/keepalived servers
                       eth1: 10.0.0.[1|2]
                                     |
                    test switch (10.0.0.0/8)
                                     |
                         10.0.0.[11|12]
                    VIP=192.168.16.123
                
test servers (real servers)
                    192.168.16.[228|229]
                                     |
                     
back to main switch

But let's focus on the 2 lvs servers...

keepalived.conf:

global_defs {
   notification_email {
     root at localhost
   }
   notification_email_from keepalived at lvs1.iper
   smtp_server 127.0.0.1
   smtp_connect_timeout 30
   router_id LVS_MASTER          ### BACKUP on the backup ###
}

vrrp_instance VI_1 {
    state MASTER          ### BACKUP on the backup ###
    interface eth0
    lvs_sync_daemon_interface eth1
    virtual_router_id 51
    priority 100                 ### 99 on the backup ###
    advert_int 1
    smtp_alert
    virtual_ipaddress {
        192.168.16.123
    }
}

virtual_server 192.168.16.123 80 {
    delay_loop 6
    lb_algo rr
    lb_kind DR
    persistence_timeout 50
    protocol TCP
    real_server 10.0.0.11 80 {
        weight 1
    }
    real_server 10.0.0.12 80 {
        weight 1
    }
    sorry_server 127.0.0.1 80
}

/var/log/messages:

Feb 20 15:01:09 lvs1 Keepalived: Starting Keepalived v1.1.16 (02/19,2009) 
Feb 20 15:01:09 lvs1 Keepalived_vrrp: Using MII-BMSR NIC polling thread...
Feb 20 15:01:09 lvs1 Keepalived_vrrp: Registering Kernel netlink reflector
Feb 20 15:01:09 lvs1 Keepalived_vrrp: Registering Kernel netlink command channel
Feb 20 15:01:09 lvs1 Keepalived_vrrp: Registering gratutious ARP shared channel
Feb 20 15:01:09 lvs1 Keepalived: Starting VRRP child process, pid=19385
Feb 20 15:01:09 lvs1 Keepalived_vrrp: Opening file '/etc/keepalived/keepalived.conf'. 
Feb 20 15:01:09 lvs1 Keepalived_vrrp: Configuration is using : 35092 Bytes
Feb 20 15:01:09 lvs1 Keepalived_vrrp: VRRP sockpool: [ifindex(2), proto(112), fd(9,10)]

And that's it... no VIP showing up... no error message...
Looking at the (outdated) log example from the keepalived doc, I seem to miss all the "parsing" of the configuration.
A bit like if it was stuck in the vrrp child...

On the backup, I get these extra:
Feb 20 15:01:18 lvs2 Keepalived_vrrp: VRRP_Instance(VI_1) Entering BACKUP STATE
Feb 20 15:01:18 lvs2 Keepalived_vrrp: VRRP sockpool: [ifindex(2), proto(112), fd(9,10)]
Feb 20 15:01:18 lvs2 Keepalived_vrrp: Remote SMTP server [127.0.0.1:25] connected.
Feb 20 15:01:18 lvs2 Keepalived_vrrp: SMTP alert successfully sent.

ps auxfw:

root     19384  0.0  0.0   4796   624 ?        Ss   15:01   0:00 keepalived -D
root     19385  0.0  0.1   4864  1048 ?        S    15:01   0:00  \_ keepalived -D

lvs1, no VIP:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue 
    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 qlen 1000
    link/ether 00:04:23:9e:f3:74 brd ff:ff:ff:ff:ff:ff
    inet 192.168.28.226/20 brd 192.168.31.255 scope global eth0
    inet6 fe80::204:23ff:fe9e:f374/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:04:23:9e:f3:75 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.1/8 brd 10.255.255.255 scope global eth1
    inet6 fe80::204:23ff:fe9e:f375/64 scope link 
       valid_lft forever preferred_lft forever
4: sit0: <NOARP> mtu 1480 qdisc noop 
    link/sit 0.0.0.0 brd 0.0.0.0

lvs2, no VIP:

1: lo: <LOOPBACK,UP,LOWER_UP> mtu 16436 qdisc noqueue 
    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 qlen 1000
    link/ether 00:04:23:b2:65:02 brd ff:ff:ff:ff:ff:ff
    inet 192.168.28.227/20 brd 192.168.31.255 scope global eth0
    inet6 fe80::204:23ff:feb2:6502/64 scope link 
       valid_lft forever preferred_lft forever
3: eth1: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc pfifo_fast qlen 100
    link/ether 00:04:23:b2:65:03 brd ff:ff:ff:ff:ff:ff
    inet 10.0.0.2/8 brd 10.255.255.255 scope global eth1
    inet6 fe80::204:23ff:feb2:6503/64 scope link 
       valid_lft forever preferred_lft forever
4: sit0: <NOARP> mtu 1480 qdisc noop 
    link/sit 0.0.0.0 brd 0.0.0.0

ipvsadm -l -n shows nothing
tcpdump -i eth1 -p vrrp shows nothing

Any idea why keepalived would not bring the VIP up and setup vrrp?

Thx,
JD


      




More information about the CentOS mailing list