LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Help with keepalived + bridge code!!

To: keepalived-devel@xxxxxxxxxxxxxxxxxxxxx
Subject: Re: [lvs-users] Help with keepalived + bridge code!!
Cc: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
From: Graeme Fowler <graeme@xxxxxxxxxxx>
Date: Wed, 06 Jun 2007 15:06:31 +0100
Putting this where it belongs, on the keepalived list (you don't appear
to be doing LVS at all). Apologies for the full post but the context is
important to include, so please scroll to the bottom for my replies!

On Wed, 2007-06-06 at 14:36 +0400, Ramsurrun Visham wrote:
> Hi to all,
> 
> I want to use keepalived with bridging code. Is that possible? My
> topology is as follows:
> 
> 
>       |Master| -------  eth1 --------- |Backup|
>     eth0 |                                       | eth0
> br0 192.168.10.2                br0 192.168.10.3
>            |                                       |
>            |                                       |
>            |     VIP 192.168.10.10       |
>            |                                       |
> 
> My bridge setup on the MASTER PC is as follows:
> ----------------------------------------
> #!/bin/bash
> echo "1" > /proc/sys/net/ipv4/ip_forward
> brctl addbr br0
> brctl stp br0 off
> brctl addif br0 eth0
> ifconfig br0 0.0.0.0
> ifconfig eth0 0.0.0.0 down
> ifconfig br0 192.168.10.2 netmask 255.255.255.0 broadcast 192.168.10.255
> ifconfig br0 up
> ifconfig eth0 up
> ----------------------------------------
> 
> The BACKUP machine is setup as above except that the IP address
> assigned to br0 is 192.168.10.3. The IP addresses of eth1 on Master is
> 192.168.100.100 and on Backup is 192.168.100.200.
> 
> My keepalived.conf on the MASTER node is as follows:
> --------------------------------------
> ! Configuration File for keepalived
> 
> global_defs {
>         lvs_id FW01
> }
> 
> vrrp_sync_group G1 {   # must be before vrrp_instance declaration
>   group {
>     VI_1
>   }
>   #notify_master /usr/src/master.sh
>   #notify_backup /usr/src/backup.sh
>   #notify_backup /etc/keepalived/backup.sh
> }
> 
> vrrp_instance VI_1 {
>     state MASTER
>     interface br0
>     lvs_sync_daemon_interface eth1
>     mcast_src_ip 192.168.100.100
>     virtual_router_id 51
>     priority 100
>     advert_int 2
>     authentication {
>       auth_type PASS
>       auth_pass visham
>     }
>     virtual_ipaddress {
>         192.168.10.10/24 dev br0
>     }
> }
> --------------------------------------
> 
> My keepalived.conf on the BACKUP node is as follows:
> --------------------------------------
> ! Configuration File for keepalived
> 
> global_defs {
>         lvs_id FW02
> }
> 
> vrrp_sync_group G1 {   # must be before vrrp_instance declaration
>   group {
>     VI_1
>   }
>   notify_master /usr/src/master.sh
>   notify_backup /usr/src/backup.sh
>   #notify_backup /etc/keepalived/backup.sh
> }
> 
> vrrp_instance VI_1 {
>     state BACKUP
>     interface br0
>     lvs_sync_daemon_interface eth1
>     mcast_src_ip 192.168.100.200
>     virtual_router_id 51
>     priority 50
>     advert_int 2
>     authentication {
>       auth_type PASS
>       auth_pass visham
>     }
>     virtual_ipaddress {
>         192.168.10.10/24 dev br0
>     }
> }
> --------------------------------------
> 
> The problem I get are as follows:
> 1) When I remove the cable connecting the Master PC to the switch,
> though the Backup PC goes into Master Mode, the notify scripts are not
> executed.
> 
> 2) The VRRP messages are not sent via eth1. They are still sent via eth0.
> 
> Can someone pls tell me why this is not working? I'm going nuts with
> this for more than 2 weeks now.

Why have you setup a bridge with only one interface?

Anyway, that's by-the-by: in both cases you have

interface br0

br0 only contains eth0; therefore your VRRP messages will be sent via
eth0 and not eth1.

If you want the VRRP on the link connecting eth1 on each machine, you
need:

vrrp_instance VI_1 {
    state MASTER
    interface eth1
    lvs_sync_daemon_interface eth1
    mcast_src_ip 192.168.100.100
    virtual_router_id 51
    priority 100
    advert_int 2
    authentication {
      auth_type PASS
      auth_pass visham
    }
    virtual_ipaddress {
        192.168.10.10/24 dev br0
    }
}

That way, the VRRP traffic goes onto eth1 and the VIP gets put on br0.

Graeme



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