LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] Simple LVs scenario (all nodes in same subnet)

To: David Coulson <david@xxxxxxxxxxxxxxxx>
Subject: Re: [lvs-users] Simple LVs scenario (all nodes in same subnet)
Cc: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
From: Javi Legido <javi@xxxxxxxxxx>
Date: Thu, 21 Jun 2012 06:02:20 -0400
Thanks, still not working, but I will move to haproxy.

Thanks again

2012/6/20 David Coulson <david@xxxxxxxxxxxxxxxx>:
> Reply to the list so other people can see what is being discussed.
>
> Try adding this to your real servers:
>
> iptables -t nat -A PREROUTING -d 10.0.0.15 -p tcp --dport 80 -j REDIRECT
>
> You don't need ip_forward enabled anywhere.
>
>
> On 6/20/12 8:34 AM, Javi Legido wrote:
>>
>> Thanks for the quick reply.
>>
>> Honestly not sure how to make it work. Do you mind to reply with below
>> information of a working example?
>>
>> Director
>>
>> -All ip's
>> -Any iptables roule?
>> -Any custom route?
>> -Yes/No 1 to /proc/sys/net/ipv4/ip_forward
>>
>> Real servers
>>
>> -All ip's
>> -Any iptables roule?
>> -Any custom route?
>> -Yes/No 1 to /proc/sys/net/ipv4/ip_forward
>>
>> Output of ipvsadm on the director
>>
>> I'm testing on a scenario where all 4 nodes (client, director and 2
>> real servers) are in the same subnet.
>>
>> Many thanks
>>
>> 2012/6/20 David Coulson <david@xxxxxxxxxxxxxxxx>:
>>>
>>> Do you have the 10.0.0.15 address configured on the real servers -
>>> Usually
>>> you put it on the loopback interface and tweak the arp configuration to
>>> make
>>> sure it doesn't arp for it.
>>>
>>> Or you can add an iptables REDIRECT rule that matches dst ip of vip and
>>> port
>>> - This is what I do, since it makes the config simpler (IMHO)
>>>
>>> Do you see the SYN packet from the client on your real servers when the
>>> request is routed from IPVS? If so, then you need one of the above
>>> suggestions. if not, you have a network issue.
>>>
>>>
>>> On 6/20/12 8:17 AM, Javi Legido wrote:
>>>>
>>>>  I'm playing with LVS, but no way to redirect HTTP request to real
>>>>    servers (details on http://pastebin.com/LUFRefnq).
>>>>    Some TCP 80 packets arrives to real servers, but looks like replies
>>>> not.
>>>>    Any simple example of LVS?
>>>>    Should I 'echo 1 > /proc/sys/net/ipv4/ip_forward' in any server?
>>>>    Thanks
>>>>    Details:
>>>>        www.dev.jj.com is an alias of balancer-1.dev.jj.com 10.0.0.15
>>>>
>>>>
>>>>  ########################################################################
>>>>        $ sudo ipvsadm
>>>>        IP Virtual Server version 1.2.1 (size=4096)
>>>>        Prot LocalAddress:Port Scheduler Flags
>>>>          -> RemoteAddress:Port           Forward Weight ActiveConn
>>>> InActConn
>>>>        TCP  balancer-1.dev.jj.com:www rr
>>>>          -> test-4.dev.jj.com:www        Route   1      0          0
>>>>
>>>> - Ignored:
>>>>          -> test-5.dev.jj.com:www        Route   1      0          0
>>>>
>>>>
>>>>
>>>>  ########################################################################
>>>>
>>>>        Client:
>>>>
>>>>        $ wget -O - http://www.dev.jj.com
>>>>        --2012-06-20 13:13:02--  http://www.dev.jj.com/
>>>>        Resolving www.dev.jj.com... 10.0.0.15
>>>>        Connecting to www.dev.jj.com|10.0.0.15|:80...
>>>>
>>>>        Balancer:
>>>>
>>>>        $ sudo ipvsadm
>>>>        IP Virtual Server version 1.2.1 (size=4096)
>>>>        Prot LocalAddress:Port Scheduler Flags
>>>>          -> RemoteAddress:Port           Forward Weight ActiveConn
>>>> InActConn
>>>>        TCP  balancer-1.dev.jj.com:www rr
>>>>          -> test-4.dev.jj.com:www        Route   1      0          0
>>>>          -> test-5.dev.jj.com:www        Route   1      0          1
>>>>
>>>> _______________________________________________
>>>> Please read the documentation before posting - it's available at:
>>>> http://www.linuxvirtualserver.org/
>>>>
>>>> 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
>>>
>>>
>>>
>
>

_______________________________________________
Please read the documentation before posting - it's available at:
http://www.linuxvirtualserver.org/

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>