LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

RE: Load-balancing directors using DNS round-robin

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: RE: Load-balancing directors using DNS round-robin
From: "Peter Mueller" <pmueller@xxxxxxxxxxxx>
Date: Thu, 2 Sep 2004 14:01:37 -0700
> - set up 2 IP's as VIP, first VIP is primarily on director 1 
> (a heartbeat
> resource), the other VIP is primarily on director 2 (also heartbeat
> resource).
> - set up every DNS A-record twice, once for VIP1 and once for 
> VIP2 (looks
> like DNS round-robin, does it ?)

> If director 1 goes down, the VIP that is primarily a resource on this
> director is moved to director 2. Likewise, if director 2 goes 
> down, director
> 1 takes over its IP.
> 
> Will this setup work with LVS-modules, ipvsadm?

You are describing VRRP (HSRP in Cisco-speak).  Have a look at
http://www.keepalived.org/.  I wouldn't bother with the LVS part of
Keepalived for this kind of setup.

Here is an example for what you want.  I use this setup with compact flash
linux routers, currently in production.

== DNS A ==
vrrp_instance VI_1 {
    state MASTER
    track_interface {
        eth0
    }
    interface eth2
    virtual_router_id 51
    priority 150
    advert_int 2
    authentication {
        auth_type PASS
        auth_pass secret
    }
    virtual_ipaddress {
        router.VRRP.address.one
    }
}

vrrp_instance VI_2 {
    state SLAVE
    track_interface {
        eth0
    }
    interface eth2
    virtual_router_id 52
    priority 100
    advert_int 2
    authentication {
        auth_type PASS
        auth_pass secret
    }
    virtual_ipaddress {
        router.VRRP.address.two
    }
}

== DNS B ==

vrrp_instance VI_1 {
    state SLAVE
    track_interface {
        eth0
        }
    interface eth2
    virtual_router_id 51
    priority 100
    advert_int 2
    authentication {
        auth_type PASS
        auth_pass secret
    }
    virtual_ipaddress {
        router.VRRP.address.one
    }
}

vrrp_instance VI_2 {
    state MASTER
    track_interface {
        eth0
        }
    interface eth2
    virtual_router_id 52
    priority 150
    advert_int 2
    authentication {
        auth_type PASS
        auth_pass secret
    }
    virtual_ipaddress {
        router.VRRP.address.two
    }
}

Larger numbers mean larger priority.  Incidentally, DNS has built-in
load-balancing capabilities.  These capabilities make it much less desireable
to bother with load-balancing on it.

Regards,

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