LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Real and Fallback in Piranha

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Real and Fallback in Piranha
From: Thomas Pedoussaut <thomas@xxxxxxxxxxxxxx>
Date: Wed, 04 Mar 2009 15:15:42 +0000
Sean Drill wrote:
> I am however only able to get piranha/lvs to do load sharing. In this
> case as long as both servers are set to UP, then traffic will be
> balanced between all servers (determined by load balancing scheme and
> weighting.) What I am attempting to do is create a virtual server in
> LVS, which has two active REAL servers, however direct traffic only to
> one of them, unless otherwise directed or if the active member fail,
> then direct traffic to the backup.
>   

The behaviour you want is achieved with a sorry server. Basically, the
first RS is on it's own in the pool, and the second RS is defined as a
sorry server, or failback, depending on the vocabulary.

Here is an example using keepalived. The first virtual service (fwmark
10) is a load balancing across the 2 RS, and the second (fwmark 11) is
in active/passive. Keep in mind to also detect failure of the backup RS
to be able to repare it before you need to use it.


virtual_server fwmark 10 {
    delay_loop 6
    lb_algo wlc
    lb_kind DR
    protocol TCP

    real_server 172.31.241.64 3306 {
        weight 100
        MISC_CHECK {
        misc_path "/usr/local/bin/check_mysql2.sh 172.31.241.64"
        misc_timeout 10
        misc_dynamic
        }
    }
    real_server 172.31.241.66 3306 {
        weight 100
        MISC_CHECK {
        misc_path "/usr/local/bin/check_mysql2.sh 172.31.241.66"
        misc_timeout 10
        misc_dynamic
        }
     }
}

virtual_server fwmark 11 {
    delay_loop 6
    lb_algo wlc
    lb_kind DR
    protocol TCP

    sorry_server 172.31.241.66 3306

    real_server 172.31.241.64 3306 {
        weight 100
        MISC_CHECK {
        misc_path "/usr/local/bin/check_mysql_fo.sh 172.31.241.64"
        misc_timeout 10
        }
    }
}

-- 
Thomas


_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

LinuxVirtualServer.org mailing list - lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Send requests to lvs-users-request@xxxxxxxxxxxxxxxxxxxxxx
or go to http://lists.graemef.net/mailman/listinfo/lvs-users

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