LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

Re: [lvs-users] "selective balancing" - make requests from 1.2.3.4 go to

To: Alex Attarian <u2sashko@xxxxxxxxx>
Subject: Re: [lvs-users] "selective balancing" - make requests from 1.2.3.4 go to realserver_A, all others - to realserver_B
Cc: "LinuxVirtualServer.org users mailing list." <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
From: Tomasz Chmielewski <tch@xxxxxxxxxxx>
Date: Fri, 7 Mar 2014 18:26:45 +0100
On Fri, 7 Mar 2014 09:18:48 -0800
Alex Attarian <u2sashko@xxxxxxxxx> wrote:

> I'm confused how this "iptables -t mangle -I PREROUTING -s 1.2.3.4 -j
> ACCEPT" sets a mark? Doesn't Tomasz need to set a mark (*-j MARK
> --set-mark 1)* and then tell ipvsadm to route based on fwmark? i.e.:
> ipvsadm -A -f 1 -s wrr -p 80 ?

"iptables -t mangle -I PREROUTING -s 1.2.3.4 -j ACCEPT" doesn't set any
mark, and that's exactly why it works: any rules setting the mark
later on are simply ignored, and requests from 1.2.3.4 hit the
webserver on this director/realserver.

One more thing I had to do was temporarily switching off this
realserver for the ldirectord (by simply setting the testpage/request to
give a bogus answer), but leaving it working otherwise.

This way, all client traffic gets directed to the healthy realserver,
while 1.2.3.4 can test the code on the other (seemingly offline for
ldirectord) realserver.

-- 
Tomasz Chmielewski
http://wpkg.org

_______________________________________________
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>