LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] localnode issue

To: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] localnode issue
From: Thomas Pedoussaut <thomas@xxxxxxxxxxxxxx>
Date: Mon, 01 Sep 2008 10:06:15 +0100
Vishwanath T. K. wrote:
> that worked, thanks for the help.
>
> i have one more question, what if i were to create a failover between the
> two nodes, how to manage the virtual IP in that case
>   
Personally, I use keepalived, a daemon that manages all that in one 
package. It's fairly easy.

I suddenly realized that LVS DR + localnode + failover means that you'd 
have to use some iptables rules and FW mark because when the transmitted 
packet arrives on the backup director after being forwarded by the 
master director, that machine will consider it as a connection "to be 
loadbalanced" rather than a packet for the real server.

So it would work, but requires a bit of fiddling around. Not for the 
faint hearted I would say.

> On Fri, Aug 29, 2008 at 3:57 PM, Thomas Pedoussaut 
> <thomas@xxxxxxxxxxxxxx>wrote:
>
>   
>> Vishwanath T. K. wrote:
>>     
>>> Hi All,
>>>
>>> I have configured the LVS in local node. The configuration included two
>>> nodes (director+real server)
>>>
>>> VIP: 192.168.2.200
>>>
>>> Node configuration:
>>>
>>> node1:
>>>          ifconfig lo:0 192.168.2.200 netmask 255.255.255.255 broadcast
>>> 192.168.2.200 up
>>>          eth0: 192.168.2.50/24 gateway 192.168.2.254, dev eth0
>>>          HTTP service listening on all interfaces.
>>>
>>> IPVSADM:
>>>          ipvsadm -A -t 192.168.2.200:80 -s rr
>>>          ipvsadm -a -t 192.168.2.200:80 -r 192.168.2.50:80
>>>          ipvsadm -a -t 192.168.2.200:80 -r 192.168.2.51:80 -g
>>>
>>>
>>> node2:
>>>          eth0: 192.168.2.51/24 gateway 192.168.2.254, dev eth0
>>>          HTTP service listening on all interfaces.
>>>
>>> Client IP: 192.168.2.1
>>>
>>> Now the problem i am having
>>>
>>> When i access 192.168.2.200 from the client, and when the service
>>>       
>> request is
>>     
>>> sent to the node2 nothing happens, while then the service request is
>>> forwarded to 192.168.2.50 (real IP on node1) the web pages are served.
>>>
>>> IPVSADM - connection output
>>>
>>> [root@node1 ~]# ipvsadm -lnc
>>> IPVS connection entries
>>> pro expire state       source             virtual            destination
>>> TCP 01:57  FIN_WAIT    192.168.2.1:50307  192.168.2.200:80
>>>       
>> 192.168.2.50:80
>>     
>>> TCP 00:52  SYN_RECV    192.168.2.1:50294  192.168.2.200:80
>>>       
>> 192.168.2.51:80
>>     
>>> Why the second node is not serving any request ? Is there
>>> setup/configuration left on the node2 ?
>>>
>>>       
>>  From your config I take you are using direct routing.
>> Your node 2 doesn't know it has to handle traffic for the VIP, so it
>> silently drops packets arriving.
>> You need to configure the VIP as an alias of lo on that node as well (
>> and play with the arp config to avoid announcing that IP on the network.
>> Add that in /etc/sysctl.conf
>> net.ipv4.conf.eth0.arp_ignore = 1
>> net.ipv4.conf.eth0.arp_announce = 2
>> net.ipv4.conf.all.arp_ignore = 1
>> net.ipv4.conf.all.arp_announce = 2
>>
>> Reading the doc http://www.linuxvirtualserver.org/VS-DRouting.html helps
>> a lot as well.
>>
>> _______________________________________________
>> 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
>>
>>     
> _______________________________________________
> 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>
  • Re: [lvs-users] localnode issue, Thomas Pedoussaut <=