0

I installed on a ubuntu 12.10 server the keepalived package and configured it, but it complains later in the syslog, that a virtual id must be set

Keep alive configuration

# Define the script used to check if haproxy is still working
vrrp_script chk_haproxy { 
    script "killall -0 haproxy"
    interval 2 
    weight 2 
}
  
# Configuation for the virtual interface
vrrp_instance VI_1 {
    state MASTER        # set this to BACKUP on the other machine

    virtual_router_id 1

    priority 101        # set this to 100 on the other machine

    interface eth0
  
    authentication {
        auth_type AH
        auth_pass myPassw0rd      # Set this to some secret phrase
    }
  
    # The virtual ip address shared between the two loadbalancers
    virtual_ipaddress {
        192.168.1.10/24
    }
     
    # Use the script above to check if we should fail over
    track_script {
        chk_haproxy
    }
}

Network configuration

auto eth0
iface eth0 inet static
    address 192.168.1.11
    netmask 255.255.255.0 

auto eth0:1
iface eth0:1 inet static
    address 192.168.1.10
    netmask 255.255.255.0 

SysLog output that tells me that the virtual id must be set... cannot find anything related to that error in any documentations

Jan 17 06:48:41 haproxy Keepalived_vrrp: Opening file '/etc/keepalived/keepalived.conf'.
Jan 17 06:48:41 haproxy Keepalived_vrrp: VRRP_Instance(VI_1) the virtual id must be set!
Jan 17 06:48:41 haproxy Keepalived_vrrp: Registering Kernel netlink reflector
Jan 17 06:48:41 haproxy Keepalived_vrrp: Registering Kernel netlink command channel
Jan 17 06:48:41 haproxy Keepalived_vrrp: Registering gratutious ARP shared channel
Jan 17 06:48:41 haproxy Keepalived_vrrp: Initializing ipvs 2.6
Jan 17 06:48:41 haproxy Keepalived_vrrp: Opening file '/etc/keepalived/keepalived.conf'.
Jan 17 06:48:41 haproxy Keepalived_vrrp: VRRP_Instance(VI_1) the virtual id must be set!
Jan 17 06:48:41 haproxy Keepalived_vrrp: Registering Kernel netlink reflector
Jan 17 06:48:41 haproxy Keepalived_vrrp: Registering Kernel netlink command channel
Jan 17 06:48:41 haproxy Keepalived_vrrp: Registering gratutious ARP shared channel
Jan 17 06:48:41 haproxy Keepalived_vrrp: Initializing ipvs 2.6
mlaug
  • 202
  • 1
  • 4
  • 12

3 Answers3

1

(This is not a answer yet, but log file is too difficult read in comment)

Ubuntu 12.10

Again, no issue at all

Network

# ifconfig
eth0      Link encap:Ethernet  HWaddr 08:00:27:66:f0:56
          inet addr:192.168.1.11  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe66:f056/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:2025 errors:0 dropped:0 overruns:0 frame:0
          TX packets:2113 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:1244217 (1.2 MB)  TX bytes:303305 (303.3 KB)

eth0:1    Link encap:Ethernet  HWaddr 08:00:27:66:f0:56
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

eth1      Link encap:Ethernet  HWaddr 08:00:27:66:2d:ba
          inet addr:10.0.0.11  Bcast:10.0.0.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fe66:2dba/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:55 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000
          RX bytes:7500 (7.5 KB)  TX bytes:468 (468.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:16436  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0
          RX bytes:0 (0.0 B)  TX bytes:0 (0.0 B)

Install

# uname -a
Linux u64s10 3.5.0-22-generic #34-Ubuntu SMP Tue Jan 8 21:47:00 UTC 2013 x86_64 x86_64 x86_64 GNU/Linux
# dpkg -l|grep keepalived
ii  keepalived    1:1.2.2-3ubuntu2    amd64    Failover and monitoring daemon for LVS clusters

syslog

Jan 20 16:26:56 u64s10 Keepalived: Starting Keepalived v1.2.2 (10/04,2012)
Jan 20 16:26:56 u64s10 Keepalived: Starting Healthcheck child process, pid=1863
Jan 20 16:26:56 u64s10 Keepalived: Starting VRRP child process, pid=1864
Jan 20 16:26:56 u64s10 Keepalived_healthcheckers: Initializing ipvs 2.6
Jan 20 16:26:56 u64s10 Keepalived_vrrp: Registering Kernel netlink reflector
Jan 20 16:26:56 u64s10 Keepalived_vrrp: Registering Kernel netlink command channel
Jan 20 16:26:56 u64s10 Keepalived_vrrp: Registering gratutious ARP shared channel
Jan 20 16:26:56 u64s10 Keepalived_vrrp: Initializing ipvs 2.6
Jan 20 16:26:57 u64s10 kernel: [  294.832154] nf_conntrack version 0.5.0 (3931 buckets, 15724 max)
Jan 20 16:26:57 u64s10 kernel: [  294.857887] IPVS: Registered protocols (TCP, UDP, SCTP, AH, ESP)
Jan 20 16:26:57 u64s10 kernel: [  294.857935] IPVS: Connection hash table configured (size=4096, memory=64Kbytes)
Jan 20 16:26:57 u64s10 kernel: [  294.857986] IPVS: Creating netns size=2064 id=0
Jan 20 16:26:57 u64s10 kernel: [  294.859535] IPVS: ipvs loaded.
Jan 20 16:26:57 u64s10 Keepalived_vrrp: Opening file '/etc/keepalived/keepalived.conf'.
Jan 20 16:26:57 u64s10 Keepalived_healthcheckers: Registering Kernel netlink reflector
Jan 20 16:26:57 u64s10 Keepalived_healthcheckers: Registering Kernel netlink command channel
Jan 20 16:26:57 u64s10 Keepalived_healthcheckers: Opening file '/etc/keepalived/keepalived.conf'.
Jan 20 16:26:57 u64s10 Keepalived_healthcheckers: Configuration is using : 4587 Bytes
Jan 20 16:26:57 u64s10 Keepalived_healthcheckers: Using LinkWatch kernel netlink reflector...
Jan 20 16:26:57 u64s10 Keepalived_vrrp: Configuration is using : 62468 Bytes
Jan 20 16:26:57 u64s10 Keepalived_vrrp: Using LinkWatch kernel netlink reflector...
Jan 20 16:26:58 u64s10 Keepalived_vrrp: VRRP_Instance(VI_1) Transition to MASTER STATE
Jan 20 16:26:59 u64s10 Keepalived_vrrp: VRRP_Instance(VI_1) Entering MASTER STATE

Ubuntu 12.04

I use OP keepalived.conf as is and am able to start it without any syslog error, with or without eth0:1 (192.168.1.10).

Installing keepalived

apt-get install keepalived

dpkg -l|grep keepalived
ii  keepalived    1:1.2.2-3ubuntu1    Failover and monitoring daemon for LVS clusters

The package come with no keepalive.conf file, only a empty /etc/keepalived directory.

ifconfig

eth0      Link encap:Ethernet  HWaddr 08:00:27:cb:0d:5c  
          inet addr:192.168.1.211  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::a00:27ff:fecb:d5c/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:8548 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3029 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:4967707 (4.9 MB)  TX bytes:290373 (290.3 KB)

eth0:1    Link encap:Ethernet  HWaddr 08:00:27:cb:0d:5c  
          inet addr:192.168.1.10  Bcast:192.168.1.255  Mask:255.255.255.0
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1

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:16436  Metric:1
          RX packets:14 errors:0 dropped:0 overruns:0 frame:0
          TX packets:14 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:780 (780.0 B)  TX bytes:780 (780.0 B)

syslog

Jan 20 03:43:54 U64D211 Keepalived: Starting Keepalived v1.2.2 (12/23,2011)
Jan 20 03:43:54 U64D211 Keepalived: Starting Healthcheck child process, pid=5140
Jan 20 03:43:54 U64D211 Keepalived_healthcheckers: Initializing ipvs 2.6
Jan 20 03:43:54 U64D211 Keepalived: Starting VRRP child process, pid=5142
Jan 20 03:43:54 U64D211 Keepalived_healthcheckers: Registering Kernel netlink reflector
Jan 20 03:43:54 U64D211 Keepalived_healthcheckers: Registering Kernel netlink command channel
Jan 20 03:43:54 U64D211 Keepalived_healthcheckers: Opening file '/etc/keepalived/keepalived.conf'.
Jan 20 03:43:54 U64D211 Keepalived_healthcheckers: Configuration is using : 4493 Bytes
Jan 20 03:43:54 U64D211 Keepalived_healthcheckers: Using LinkWatch kernel netlink reflector...
Jan 20 03:43:54 U64D211 Keepalived_vrrp: Registering Kernel netlink reflector
Jan 20 03:43:54 U64D211 Keepalived_vrrp: Registering Kernel netlink command channel
Jan 20 03:43:54 U64D211 Keepalived_vrrp: Registering gratutious ARP shared channel
Jan 20 03:43:54 U64D211 Keepalived_vrrp: Initializing ipvs 2.6
Jan 20 03:43:54 U64D211 Keepalived_vrrp: Opening file '/etc/keepalived/keepalived.conf'.
Jan 20 03:43:54 U64D211 Keepalived_vrrp: Configuration is using : 62374 Bytes
Jan 20 03:43:54 U64D211 Keepalived_vrrp: Using LinkWatch kernel netlink reflector...
Jan 20 03:43:55 U64D211 Keepalived_vrrp: VRRP_Instance(VI_1) Transition to MASTER STATE

The syslog output seems to be different.

John Siu
  • 3,577
  • 2
  • 15
  • 23
  • @mlaug (1) How did you install keepalived? What version you using? (2) How many nic does that machine has? – John Siu Jan 20 '13 at 08:55
  • 1
    (3) Do you have another box running keepalive and using "virtual_router_id 1"? – John Siu Jan 20 '13 at 09:56
  • I have two NIC running, one on the local interface, the other on a public interface. I configured it using with apt from ubuntu server 12.10. there is no additional machine running – mlaug Jan 20 '13 at 15:58
  • I put additional nic in my box but my keepalived still don't give any error. I have to check it on 12.10. There must be something different. – John Siu Jan 20 '13 at 20:03
  • 12.10 tested, no issue. Please post following (1) `uname -a` (2) `iptables -L` (3) `pstree` (4) `ip addr show` (5) `dpkg -l|grep keepalived` – John Siu Jan 20 '13 at 21:34
  • What is the output of `service ipvsadm status`? – John Siu Jan 22 '13 at 17:54
  • mh it seem to work with setting the router id from 1 to any number above... strange though since there is no nothing using this router id and no other installation. routing no works out of the box. thanks! – mlaug Jan 23 '13 at 06:21
0

Not sure if it is related to the error as shown in the log, but you shouldn't set the VIP on the machine yourself. Keepalived will take care of it.

So remove the eth0:0 alias in /etc/network/interfaces.

quanta
  • 50,327
  • 19
  • 152
  • 213
zecrazytux
  • 639
  • 3
  • 7
  • sadly that did not change anything – mlaug Jan 18 '13 at 02:58
  • I tested it, it works with or without eth0:1. The strange thing is, I use OP config file and it will just run. I am using Ubuntu 12.04 but keepalived version is the same on 12.10. – John Siu Jan 20 '13 at 08:39
0

Ran into the same error message recently and thought I would add the solution here. In our case, the contents of the config file had been cut & pasted through a windows text editor. Although the file looked fine in Windows (and in VI), it was obvious when looking at the file using "less" that there were some problems.

Looking at the source code, you can see that the error message is basically a catch-all for problems with the config file. Error message:

Jan 28 17:08:02 Test-LB1 Keepalived_vrrp[7027]: VRRP_Instance(VI_1) the virtual id must be set!

After cleaning up the file and using regular spaces, everything is working fine.

Non-space whitespace breaks config

flakshack
  • 101
  • 2