Take a look at this link and see if it help. I found it to be pretty useful.
On Sun, 19 Sep 2010 16:59:44 +0200
Tomasz Chmielewski <mangoo@xxxxxxxx> wrote:
> Is it possible to load balance queries to localhost?
> Say, I have two servers - I'd like them to be both directors and realservers.
> Application connecting to localhost:1111 should be connected to either one or
> the other server. Despite many tries, I'm not able to achieve this.
> I had partial success with LVS-NAT rules:
> -A -t 127.0.0.1:1111 -s lc
> -a -t 127.0.0.1:1111 -r 10.0.0.10:1111 -m -w 1 # same server as localhost,
> -a -t 127.0.0.1:1111 -r 10.0.0.20:1111 -m -w 1 # remote server
> Where the remote realserver receives the packet:
> 16:54:18.078365 IP (tos 0x10, ttl 64, id 52411, offset 0, flags [DF], proto
> TCP (6), length 60) 127.0.0.1.50427 > 10.0.0.20.1111: S, cksum 0xc03d
> (correct), 1282046761:1282046761(0) win 32792 <mss 16396,sackOK,timestamp
> 178066 0,nop,wscale 7>
> But I guess it's confused about what to do with it, since it appears to come
> from 127.0.0.1.
> Tomasz Chmielewski
> Please read the documentation before posting - it's available at:
> 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:
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