LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Problems getting keepalived to set VIP

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Problems getting keepalived to set VIP
From: paul.rogers@xxxxxxxxxx
Date: Mon, 3 Feb 2003 13:23:39 +0000
Dear All

I am having some problems setting keepalived up.

I have a working LVS-DR.  I also can get Keepalived to start the LVS, if I have 
already setup the VIP using the following:

#add ethernet device and routing for VIP 11.81.19.203
/sbin/ifconfig eth0:203 10.80.18.203 broadcast 11.81.19.203 netmask 
255.255.255.0
/sbin/route add -host 11.81.19.203 dev eth0:203

The keepalived.conf file is as follows:

! Sample configuration for real server group declaration
! Note yet implemented .....

global_defs {
  notification_email {
       test.user@xxxxxxxx
     }
     notification_email_from test.user@xxxxxxxx
     smtp_server 182.24.2.1
   smtp_connect_timeout 30
  lvs_id LVS_MAIN
}



virtual_server 11.81.19.203 {
  delay_loop 6
  lb_algo rr
  lb_kind DR
  persistence_timeout 900
  protocol TCP
!  virtualhost lvscentral

  real_server 11.81.19.44 80 {
    weight 1
  }
  real_server 11.81.19.45 80 {
    weight 1
  }
}


The problem occurs when I try to get keepalived to set up the VIP using a vrrp 
instance.  
The config is as follows (I copied it out of the LVS-NAT howto and just removed 
the instance for the gateway).

! vrrp_sync_groups make sure that several router instances 
! stay together on a failure - a good example of this is 
! that the external interface on one router fails and the backup server 
! takes over, you want the internal interface on the failed server 
! to failover as well, otherwise nothing will work. 
! you can have as many vrrp_sync_group blocks as you want. 
vrrp_sync_group VG1 { 
   group { 
      VI_1  
   } 
} 

! each interface needs at least one vrrp_instance 
! each vrrp_instance is a group of VIPs that are logically grouped 
! together 
! you can have as many vrrp_instaces as you want 

vrrp_instance VI_1 { 
        state MASTER 
        interface eth0 
     
        lvs_sync_daemon_inteface eth0 

    ! each virtual router id must be unique per instance name! 
        virtual_router_id 51 

    ! MASTER and BACKUP state are determined by the priority 
    ! even if you specify MASTER as the state, the state will 
    ! be voted on by priority (so if your state is MASTER but your 
    ! priority is lower than the router with BACKUP, you will lose 
    ! the MASTER state) 
    ! I make it a habit to set priorities at least 50 points apart 
    ! note that a lower number is lesser priority - lower gets less vote 
        priority 150 

    ! how often should we vote, in seconds? 
        advert_int 1 

    ! send an alert when this instance changes state from MASTER to BACKUP 
        smtp_alert 

    ! this authentication is for syncing between failover servers 
    ! keepalived supports PASS, which is simple password 
    ! authentication 
    ! or AH, which is the IPSec authentication header. 
    ! I don\'t use AH 
    ! yet as many people have reported problems with it 
        authentication { 
                auth_type PASS 
                auth_pass example 
        } 

    ! these are the IP addresses that keepalived will setup on this 
    ! machine. Later in the config we will specify which real 
        ! servers  are behind these IPs 
    ! without this block, keepalived will not setup and takedown the 
    ! any IP addresses 
     
        virtual_ipaddress { 
                11.81.19.203 
        ! and more if you want them 
        } 
} 

Running keepalived with the -d option gives the following output in 
/var/log/messages.

Jan 31 08:44:22 lvscentral Keepalived: Starting Keepalived v1.0.0 (06/01, 2003) 
Jan 31 08:44:22 lvscentral Keepalived: Remove a zombie pid file 
/var/run/keepalived.pid.
Jan 31 08:44:22 lvscentral Keepalived: Configuration is using : 97622 Bytes
Jan 31 08:44:22 lvscentral kernel: IPVS: [rr] scheduler registered.
Jan 31 08:44:22 lvscentral Keepalived: Netlink reflector reports IP 
11.81.19.202 added
Jan 31 08:44:22 lvscentral Keepalived: Registering Kernel netlink reflector
Jan 31 08:44:22 lvscentral Keepalived: ------< Global definitions >------
Jan 31 08:44:22 lvscentral Keepalived:  LVS ID = LVS_MAIN
Jan 31 08:44:22 lvscentral Keepalived:  Smtp server = 182.24.2.1
Jan 31 08:44:22 lvscentral Keepalived:  Smtp server connection timeout = 30
Jan 31 08:44:22 lvscentral Keepalived:  Email notification from = 
test.user@xxxxxxxx
Jan 31 08:44:22 lvscentral Keepalived:  Email notification = test.user@xxxxxxxx
Jan 31 08:44:22 lvscentral Keepalived: ------< SSL definitions >------
Jan 31 08:44:22 lvscentral Keepalived:  Using autogen SSL context
Jan 31 08:44:22 lvscentral Keepalived: ------< VRRP Topology >------
Jan 31 08:44:22 lvscentral Keepalived:  VRRP Instance = VI_1
Jan 31 08:44:22 lvscentral Keepalived:    Want State = MASTER
Jan 31 08:44:22 lvscentral Keepalived:    Runing on device = eth0
Jan 31 08:44:22 lvscentral Keepalived:    Virtual Router ID = 51
Jan 31 08:44:22 lvscentral Keepalived:    Priority = 150
Jan 31 08:44:22 lvscentral Keepalived:    Advert interval = 1sec
Jan 31 08:44:22 lvscentral Keepalived:    Preempt Active
Jan 31 08:44:22 lvscentral Keepalived:    Authentication type = SIMPLE_PASSWORD
Jan 31 08:44:22 lvscentral Keepalived:    Password = example
Jan 31 08:44:22 lvscentral Keepalived:    VIP count = 1
Jan 31 08:44:22 lvscentral Keepalived:      VIP1 = 11.81.19.203/32
Jan 31 08:44:22 lvscentral Keepalived:    Using smtp notification
Jan 31 08:44:22 lvscentral Keepalived: ------< VRRP Sync groups >------
Jan 31 08:44:22 lvscentral Keepalived:  VRRP Sync Group = VG1, MASTER
Jan 31 08:44:22 lvscentral Keepalived:    monitor = VI_1
Jan 31 08:44:22 lvscentral Keepalived: ------< LVS Topology >------
Jan 31 08:44:22 lvscentral Keepalived:  System is compiled with LVS v1.0.6
Jan 31 08:44:22 lvscentral Keepalived:  VIP = 11.81.19.203, VPORT = 0
Jan 31 08:44:22 lvscentral Keepalived:    delay_loop = 6, lb_algo = rr
Jan 31 08:44:22 lvscentral Keepalived:    persistence timeout = 900
Jan 31 08:44:23 lvscentral Keepalived:    protocol = TCP
Jan 31 08:44:23 lvscentral Keepalived:    lb_kind = DR
Jan 31 08:44:23 lvscentral Keepalived:    RIP = 11.81.19.44, RPORT = 80, WEIGHT 
= 1
Jan 31 08:44:23 lvscentral Keepalived:    RIP = 11.81.19.45, RPORT = 80, WEIGHT 
= 1
Jan 31 08:44:23 lvscentral Keepalived: VRRP sockpool: [ifindex(2), proto(112), 
fd(5)]
Jan 31 08:44:24 lvscentral Keepalived: VRRP_Instance(VI_1) Transition to MASTER 
STATE
Jan 31 08:44:25 lvscentral Keepalived: VRRP_Instance(VI_1) Entering MASTER STATE
Jan 31 08:44:25 lvscentral Keepalived: VRRP_Instance(VI_1) setting protocol 
VIPs.
Jan 31 08:44:25 lvscentral Keepalived: VRRP_Instance(VI_1) Sending gratuitous 
ARP on eth0
Jan 31 08:44:25 lvscentral Keepalived: Remote SMTP server [182.24.2.1:25] 
connected.
Jan 31 08:44:25 lvscentral Keepalived: Netlink reflector reports IP 
11.81.19.203 added
Jan 31 08:44:25 lvscentral Keepalived: SMTP alert successfully sent.
Jan 31 08:44:30 lvscentral Keepalived: VRRP_Instance(VI_1) Sending gratuitous 
ARP on eth0


I notice the authentication type is SIMPLE_PASSWORD.  Doees this need setting 
up in any way?
Can any one suggest what I\'m missing?


Many thanks

Paul



*****************************************************************************
This email and any attachments transmitted with it are confidential
and intended solely for the use of the individual or entity to whom
they are addressed. If you have received this email in error please
notify the sender and do not store, copy or disclose the content
to any other person.

It is the responsibility of the recipient to ensure that opening this
message and/or any of its attachments will not adversely affect
its systems. No responsibility is accepted by the Company.
*****************************************************************************


<Prev in Thread] Current Thread [Next in Thread>