LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Fallback directive in ldirectord - what does it actually

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Fallback directive in ldirectord - what does it actually do?
From: Simon Horman <horms@xxxxxxxxxxxx>
Date: Sat, 19 Jul 2008 09:23:45 +1000
On Fri, Jul 18, 2008 at 03:00:03PM +0800, Simon Oxwell wrote:
> Hi,
> 
> I'm trying to set up a fallback directive in ldirectord for a service 
> that I'm using LVS-NAT to load balance to.
> 
> My setup closely follows the examples[1] that I've seen about the internet:
> 
> ldirectord.cf:
> 
> # Global Directives
> checktimeout=3
> checkinterval=5
> fallback=127.0.0.1:80
> autoreload=yes
> logfile="/var/log/ldirectord.log"
> quiescent=yes
> 
> virtual=134.115.4.218:80
>          real=10.50.48.11:7778 masq
>          real=10.50.48.12:7778 masq
>          fallback=127.0.0.1:80
>          service=http
>          request="/index.html"
>          receive="Welcome"
>          virtualhost=my.murdoch.edu.au
>          scheduler=lc
>          persistent=600
>          #netmask=255.255.255.255
>          protocol=tcp
> 
> when the realservers are down, ipvsadm gives me this:
> 
> IP Virtual Server version 1.2.1 (size=4096)
> Prot LocalAddress:Port Scheduler Flags
>    -> RemoteAddress:Port           Forward Weight ActiveConn InActConn
> TCP  my.murdoch.edu.au:www lc persistent 600
>    -> localhost.localdomain:www    Local   1      0          0
> 
> and when I try to connect, ipvsadm -Lcn give me:
> 
> IPVS connection entries
> pro expire state       source             virtual            destination
> TCP 00:48  SYN_RECV    134.115.82.191:4437 134.115.4.218:80   127.0.0.1:80
> TCP 00:50  SYN_RECV    134.115.82.191:4457 134.115.4.218:80   127.0.0.1:80
> TCP 00:49  SYN_RECV    134.115.82.191:4447 134.115.4.218:80   127.0.0.1:80
> TCP 00:49  SYN_RECV    134.115.82.191:4441 134.115.4.218:80   127.0.0.1:80
> 
> And I have an apache instance listening on 127.0.0.0:80.
> 
> Trouble is that the connection doesn't actually appear work - I get a 
> connection error.
> 
> Digging a little deeper, it seems that all I get is the client 
> workstation sends a SYN to port 80 on the VIP, and gets returned a RST/ACK.
> 
> I've seen a response in the mail list archives from a similar problem 
> that suggests that I have my apache server listen on *:80 instead, but 
> surely can't be right, because that would be an actual service listening 
> on the port, rather than a redirection by ipvs?
> 
> (the ldirectord man page tells me it could a redirection to anywhere:
>         fallback = ip_address|hostname[:portnumber|sercvicename]
>         [gate|masq|ipip]
> 
>         the server onto which a webservice is redirected if all
>         real servers are down. Typically this would be 127.0.0.1
>         with an emergency page.
> 
>         This directive may also appear within a virtual server, in
>         which case it will overide the global fallback server, if
>         set.)
> 
> 
> So, what is it that I've got misconfigured? Or is it a case of not 
> understanding what it is that the fallback directive actually does in 
> this case?

Can you try setting apache to listen on 134.115.4.218:80?

The connections from end-users should have that as their source IP address
and port at the time that they are received by apache.

-- 
Horms



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