LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Fault recover.

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: Fault recover.
From: Horms <horms@xxxxxxxxxxxx>
Date: Fri, 3 Oct 2003 15:11:50 +0900
On Thu, Oct 02, 2003 at 05:47:05PM +0200, Carles Xavier Munyoz Baldó wrote:
> Hi,
> I'm setting up a high availability LVS director with RedHat 8.0 
> (kernel-2.4.20-20.8), ipvs-1.0.9 and keepalived.
> I'm running LVS with connection synchronisation enabled.
> 
> When the master director faults, the backup director takes its role and all 
> stablished connections works without interruption. 
> GREAT !!!!! :-)
> 
> The problem is, what to when the fault master is recovered ?
> How may I copy the connection table of the backup director to the master 
> director ? This way when I bring back the master director the stablished 
> connections will not stop.
> 
> Is it possible ?
> Which are the steps for the master director reactivacion without stoping the 
> current stablished connections in the backup director ?

There are various ways to do this, here is the one I would suggest.

1. Read this post and patch by Alexandre Cassen

http://marc.theaimsgroup.com/?l=linux-virtual-server&m=105459391703228&w=2

2. The patch was put into LVS 1.1.X but not 1.0.X
   so if you want that behaviour and you are using
   LVS 1.0.X (i.e. 2.4.X kernel) you will need to 
   patch the code yourself.

3. You may want this patch too which fixes a small bug
   in Alexandre's code.

--- ipvs-1.0.10.syncd.orig/ipvs/ip_vs_core.c    2003-07-29
23:37:12.000000000 +0900
+++ ipvs-1.0.10.syncd/ipvs/ip_vs_core.c 2003-09-29 16:02:33.000000000 +0900
@@ -1132,7 +1132,7 @@
        /* increase its packet counter and check if it is needed
           to be synchronized */
        atomic_inc(&cp->in_pkts);
-       if (ip_vs_sync_state == IP_VS_STATE_MASTER &&
+       if (ip_vs_sync_state & IP_VS_STATE_MASTER &&
            (cp->protocol != IPPROTO_TCP ||
             cp->state == IP_VS_S_ESTABLISHED) &&
            (atomic_read(&cp->in_pkts) % 50 == sysctl_ip_vs_sync_threshold))

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