LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: Fallback to apache on director with ldirectord

To: lvs-users@xxxxxxxxxxxxxxxxxxxxxx
Subject: Re: Fallback to apache on director with ldirectord
From: Horms <horms@xxxxxxxxxxxx>
Date: Wed, 30 Nov 2005 01:29:57 +0000 (UTC)
ankush grover <ankushgrover1711@xxxxxxxxx> wrote:
> On 10/27/05, Horms <horms@xxxxxxxxxxxx> wrote:
>>
>> On Mon, Oct 24, 2005 at 02:02:04PM +1000, Guy Waugh wrote:
>>
>> [xnip]
>> > virtual=10.0.0.1:80
>> >         real=192.168.1.1:80 masq
>> >       real=192.168.1.2:80 masq
>> >         fallback=127.0.0.1:80 masq
>> >         quiescent=no
>> >         checktype=connect
>> >         service=none
>> >         scheduler=wlc
>> >         persistent=600
>> >         protocol=tcp
>> >
>> > When apache on the real servers is shut down, 'ipvsadm -L' shows that
>> > the service has fallen back to 127.0.0.1:80 (as do the ldirectord logs),
>> > but I can't connect to the service - it says 'connection refused'. I'm
>> > trying to connect from my workstation, and the connection works fine
>> > when apache on the real servers is up and running.
>> >
>> > When the service is in fallback mode, I can telnet to port 80 on
>> > 127.0.0.1 from the director, and a 'GET / HTTP/1.1' with a correct HTTP
>> > Host: header works, so apache on the director is answering requests to
>> > 127.0.0.1 port 80. The problem seems to be that the LVS code isn't
>> > handing the connection from my workstation off to 127.0.0.1:80 - it
>> > doesn't in fact seem to be listening to connections at all.
>> >
>> > Anyone have any ideas on what I could try?
>>
>> As you have persistance set, you need to set
>> /proc/sys/net/ipv4/vs/expire_quiescent_template to 1
>> Else persistance will continue to take effect
>> for hosts that have connected within the past
>> 600 seconds.
>>
>> --
>> Horms
>>
> hey ,
> 
> I like to know one more thing.Only one parameter is needed in
> /etc/sysctl.conf
> 
> net.ipv4.vs.expire_quiescent_template = 1
> 
> I have given 2 more parameters in /etc/sysctl.conf
> 
> net.ipv4.vs.expire_nodest_conn = 1
> net.ipv4.vs.secure_tcp = 3
> 
> and I get the error when I put the another parameter
> 
> error: 'net.ipv4.vs.timeout_finwait' is an unknown key
> 
> I wanted to divert the connections to the other real server when the first
> real server goes down.
> 
> But the problem I am facing is that
> 
> The connections are diverted to the other real server when all the
> connections with the first real server expires.

This is preciscly the problem that setting
net.ipv4.vs.expire_quiescent_template should solve.

Try examining the output of ipvsadm -Lcn, 
paying particular attention th persistance templates
(the ones with the real-server port set to 0).
They should be invalidated when the real-server they
are associated with is quiesced (has its weight set to 0).
You can do that manually, or using ldirectord to monitor
the availability of your real-servers, as per
your configuration above.



-- 
Horms


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