LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: can lvs do this...?

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: can lvs do this...?
From: Horms <horms@xxxxxxxxxxxx>
Date: Mon, 5 Aug 2002 18:01:41 +0900
On Fri, Aug 02, 2002 at 11:57:45AM -0400, Michael Park wrote:
> 
> hello!
> 
> i have a rather difficult problem that i am trying to solve and i have
> been researching whether or not lvs can serve as a possible solution. i
> have read all of the online documentation and browsed through the
> mailing lists archives, but thus far, i have been unable to find much
> helpful information. 

Hi Michael,

I have read through your setup and believe that this can be done.
Though you are going to have to do some testing to verify this.  (You
can use something like vmware if you don't have spare hardware lying
around).

You speak of two clusters, A and B. I am going to talk in terms of two
groups of real servers. Real-A1 ... Real-An and Real-B1 ..  Real-Bn. We
also have two virtual services, VS-1 and VS-2. This should map to your
clusters but makes it easier to explain in terms of LVS.


VS-1 is a fwmark virtual service for fwmark 1.  iptables is set up to
mark incoming packets for your VIP destined to ports 80 and 443 with
fwmark 1.  It also has persistance set to 1800 seconds

VS-2 is the same, except it is for fwmark 2 and ports 81 and 444 are
matched.


To use "Cluster A" you have VS-1 set up with Real-Ax set to non-zero
weights and Real-Bx set to a zero weight.

This means that incoming traffic to your VIP on ports 80 and 443 will be
sent to the real servers Real-A1 ... Real-An. As persistance is turned
on an end user will consistently be sent to the same real server for
both port 80 and 443.

VS-2 is set up  with Real-Ax set to a sero weight and Real-Bx set to a
non-zero weight.

This gives you loadbalancing of ports 81 and 444 to Real-B1 ... Real-Bn.


To swap the clusters over all that you need to do is modify all the
non-zero weights to zero and all the zero weights to something non-zero
(for instance 1).

Any end-user that has connected in the last half hour (1800 seconds)
will have their connection sent to the same real server that they
connected to before.  That is it will be sent to a server in the Real-Ax
pool. Any connections from new end-users will go to servers in the pool
Real-Bx.

The only catch is that the each end-user must have no activity for 1800
seconds before they will be handled by Real-Bx. You may want to consider
lowering the persistance value immediately after a changeover.


Again, I have not tested this but I am pretty sure this will work.

-- 
Horms
        


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