Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

I have compiled and configured keepalived but it won't start.

This is my very basic config;

    vrrp_sync_group PUBLIC_WEB_IPS {
            group {
                    public_http_ip_lan
            }
    }

    vrrp_instance public_http_ip_lan {
            state MASTER
            interface br1118
            virtual_router_id 18
            priority 100
            advert_int 1
            virtual_ipaddress {
                    192.168.0.254/24 dev br1118
            }
            nopreempt

    }

When I start keepalived I get no errors, but it it seems to get most of the wait starting up then, pauses/hangs? This is from /var/log/syslog when starting keepalived;

Apr 11 17:25:33 basil Keepalived[8047]: Starting Keepalived v1.2.7 (04/08,2013)
Apr 11 17:25:33 basil Keepalived[8048]: Starting Healthcheck child process, pid=8051
Apr 11 17:25:33 basil Keepalived[8048]: Starting VRRP child process, pid=8052
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Initializing ipvs 2.6
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Interface queue is empty
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, eth0
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, eth1.116
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, br1116
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, eth1.118
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: No such interface, br1118
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP 10.0.115.69 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP 10.0.116.249 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP 192.168.0.250 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::220:edff:fe9f:9774 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Netlink reflector reports IP fe80::2a0:c9ff:fe8f:4164 added
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Registering Kernel netlink reflector
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Registering Kernel netlink command channel
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Configuration is using : 2777 Bytes
Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Using LinkWatch kernel netlink reflector...

keepalived is still running (and CPU usage is 2~3%, RAM 10%)

user@basil:/usr/local/etc/keepalived$ ps aux | grep keepalived
root      8048  0.0  0.1   8372   808 ?        Ss   17:25   0:00 /usr/local/sbin/keepalived -D
root      8051  0.0  0.3   8492  1820 ?        S    17:25   0:00 /usr/local/sbin/keepalived -D
root      8052  0.0  0.2   8492  1344 ?        S    17:25   0:00 /usr/local/sbin/keepalived -D

Nothing is show in tcpdump when I start up keepalived, no advertisements for example:

user@basil:~$ sudo tcpdump -nlASX -s 0 -vvv -e src net 192.168.0.0/24 and not port 22tcpdump: listening on eth0, link-type EN10MB (Ethernet), capture size 65535 bytes

The bridge interface is up (as this runs across a seperate vlan);

user@basil:/usr/local/etc/keepalived$ ip a s br1118
11: br1118: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UP 
    link/ether 00:a0:c9:8f:41:64 brd ff:ff:ff:ff:ff:ff
    inet 192.168.0.250/24 brd 192.168.0.255 scope global br1118
    inet6 fe80::2a0:c9ff:fe8f:4164/64 scope link 
       valid_lft forever preferred_lft forever

I can ping hosts on that VLAN. What is going on here, I suspect I have made a really silly mistake but I can't spot anything wrong.

UPDATE:

As request:

user@basil:~$ ifconfig -a
br1116    Link encap:Ethernet  HWaddr 00:a0:c9:8f:41:64  
          inet addr:xxxxx  Bcast:xxxxx  Mask:xxxx
          inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1120 (1.0 KiB)  TX bytes:468 (468.0 B)

br1118    Link encap:Ethernet  HWaddr 00:a0:c9:8f:41:64  
          inet addr:xxxxx  Bcast:xxxxx  Mask:xxxx
          inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1064 (1.0 KiB)  TX bytes:468 (468.0 B)

eth0      Link encap:Ethernet  HWaddr 00:20:ed:9f:97:74  
          inet addr:xxxx  Bcast:xxxxx  Mask:xxxxx
          inet6 addr: fe80::220:edff:fe9f:9774/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:169 errors:0 dropped:0 overruns:0 frame:0
          TX packets:96 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:20019 (19.5 KiB)  TX bytes:11089 (10.8 KiB)

eth1      Link encap:Ethernet  HWaddr 00:a0:c9:8f:41:64  
          inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:150 errors:0 dropped:10 overruns:0 frame:0
          TX packets:30 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:11680 (11.4 KiB)  TX bytes:2436 (2.3 KiB)

eth1.116  Link encap:Ethernet  HWaddr 00:a0:c9:8f:41:64  
          inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:20 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1120 (1.0 KiB)  TX bytes:936 (936.0 B)

eth1.118  Link encap:Ethernet  HWaddr 00:a0:c9:8f:41:64  
          inet6 addr: fe80::2a0:c9ff:fe8f:4164/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:19 errors:0 dropped:0 overruns:0 frame:0
          TX packets:12 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1064 (1.0 KiB)  TX bytes:936 (936.0 B)

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:65536  Metric:1
          RX packets:10 errors:0 dropped:0 overruns:0 frame:0
          TX packets:10 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:732 (732.0 B)  TX bytes:732 (732.0 B)

I have just rebooted this box, that is why the traffic counters are low.

share|improve this question
    
can you show an output of a ifconfig -a also –  Mike Apr 11 '13 at 16:40
    
@Mike all done sir –  jwbensley Apr 11 '13 at 16:45
add comment

2 Answers

Startup Issues with keepalived are usually because of a mistake in keepalived.conf file. Keepalived currently doesn't support checking of the config file and if it finds any mistakes it will usually ignore all mistakes it can.

But there is a way to easier detect configuration problems. You should start keepalived with a -d switch which will dump the configuration data into syslog. If you installed it from a Red Hat/Centos package, just edit /etc/sysconfig/keepalived and append the -d to the KEEPALIVED_OPTIONS variable:

KEEPALIVED_OPTIONS="-D -d"

Now when you start keepalived you will be able to read in syslog what configuration data did keepalived parse. Also if some parts of the configuration work and some don't, it is probably because you forgot to close one configuration block with a closing bracket.

share|improve this answer
add comment
up vote 0 down vote accepted

The scenario I was experiencing was that keepalived starts up and does nothing, with the last log line being;

Apr 11 17:25:33 basil Keepalived_healthcheckers[8051]: Using LinkWatch
kernel netlink reflector...

After removing the set up and starting a fresh I have found that there are two scenarios in which keepalived will stop at this point and do nothing;

  1. Keepalived is being pointed to the keepalived.conf file, so it is technically starting up with no config

  2. Keepalived is loading the config file, but there is a mistake (typo for example)

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.