LVS + Piranha + Direct Routing + iptables Problem

Anil Pillai <[email protected]> Tue, 5 Jan 2010 10:43:43 +0530
Newsgroups gmane.linux.redhat.piranha
Message-ID <[email protected]>
--===============2168632211235121268==
Content-Type: multipart/alternative; boundary=001636c5a6b2dbb20d047c63e60f

--001636c5a6b2dbb20d047c63e60f
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

  Hi,

I was able to implement LVS with Direct Routing (iptables).
I am facing a problem while using the iptables which requires

iptables enrty on Real servers like this (iptables =96t nat =96A PREROUTING=
 =96p
tcp =96d <VIP> --dport <port> -j REDIRECT).



Below is a brief on the setup:



I have 3 servers Apache installed on all three servers (Port 80).



Server 1 (10.50.57.22)  -> 10.50.57.55 (VIP) -> running =93Pulse=94

Server 2 (10.50.57.40)

Server 3 (10.50.57.48)



I have configured LVS on port 80.  Added the below iptables entry on
10.50.57.40 & 10.50.57.48

iptables =96t nat =96A PREROUTING =96p tcp =96d 10.50.57.55 --dport 80 -j R=
EDIRECT



With the above setup everything works fine. Even Apache on Server 1 (Which
has the VIP) get the request as part of Load sharing.



But if I add the iptables entry in Server 1 (10.50.57.22), Requests are
received only on the Apache installed this host.



The reason for doing this is to implement redundancy. Like in my case I hav=
e
implemented the redundant setup on Server 2 (10.50.57.40) and once the
=93pulse=94 is stopped on Server 1(10.50.57.22), =93pulse=94 is automatical=
ly
started on Server 2 (10.50.57.40) which acquired the VIP (10.50.57.55). But
since iptables is already active with the above entry all the requests are
going to the Apache of same host (10.50.57.40).



Does anyone faced similar issue ?

--001636c5a6b2dbb20d047c63e60f
Content-Type: text/html; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

<div class=3D"gmail_quote">
<div>
<div class=3D"h5">
<div class=3D"gmail_quote">
<div><span style=3D"COLOR: #1f497d"><font size=3D"3"><font face=3D"Calibri"=
>Hi,</font></font></span></div>
<div><span style=3D"COLOR: #1f497d"><font size=3D"3"><font face=3D"Calibri"=
></font></font></span>=A0</div>
<div><span style=3D"COLOR: #1f497d"><font size=3D"3"><font face=3D"Calibri"=
>I was able to implement LVS with Direct Routing (iptables). </font></font>=
</span></div>
<div><span style=3D"COLOR: #1f497d"><font face=3D"Calibri"><font size=3D"3"=
>I am facing a problem=A0while using the iptables which requires </font>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3">iptables enrty on Real servers like this (iptable=
s =96t nat =96A PREROUTING =96p tcp =96d &lt;VIP&gt; --dport &lt;port&gt; -=
j REDIRECT).</font></span></p>

<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"></font></span>=A0</p><span style=3D"COLOR: #1f497=
d">
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3">Below is a brief on the setup:</font></span></p><=
/span></font></span></div>
<div>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri"></font></font></span>=A0</=
p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri">I have 3 servers Apache in=
stalled on all three servers (Port 80).</font></font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font face=3D"Calibri" size=3D"3">=A0</font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri">Server 1 (10.50.57.22)=A0 =
-&gt; 10.50.57.55 (VIP) -&gt; running =93Pulse=94</font></font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri">Server 2 (10.50.57.40)</fo=
nt></font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri">Server 3 (10.50.57.48)</fo=
nt></font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font face=3D"Calibri" size=3D"3">=A0</font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri">I have configured LVS on p=
ort 80. =A0Added the below iptables entry on 10.50.57.40 &amp; 10.50.57.48<=
/font></font></span></p>

<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri">iptables =96t nat =96A PRE=
ROUTING =96p tcp =96d 10.50.57.55 --dport 80 -j REDIRECT</font></font></spa=
n></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font face=3D"Calibri" size=3D"3">=A0</font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri">With the above setup every=
thing works fine. Even Apache on Server 1 (Which has the VIP) get the reque=
st as part of Load sharing.</font></font></span></p>

<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font face=3D"Calibri" size=3D"3">=A0</font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
red"><font size=3D"3"><font face=3D"Calibri">But if I add the iptables entr=
y in Server 1 (10.50.57.22), Requests are received only on the Apache insta=
lled this host.</font></font></span></p>

<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font face=3D"Calibri" size=3D"3">=A0</font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri">The reason for doing this =
is to implement redundancy. Like in my case I have implemented the redundan=
t setup on Server 2 (10.50.57.40) and once the =93pulse=94 is stopped on Se=
rver 1(10.50.57.22), =93pulse=94 is automatically started on Server 2 (10.5=
0.57.40) which acquired the VIP (10.50.57.55). But since iptables is alread=
y active with the above entry all the requests are going to the Apache of s=
ame host (10.50.57.40).</font></font></span></p>

<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri"></font></font></span>=A0</=
p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font size=3D"3"><font face=3D"Calibri">Does anyone faced similar =
issue ?</font></font></span></p>
<p class=3D"MsoNormal" style=3D"MARGIN: 0in 0in 0pt"><span style=3D"COLOR: =
#1f497d"><font face=3D"Calibri" size=3D"3"></font></span>=A0</p></div></div=
></div></div></div>

--001636c5a6b2dbb20d047c63e60f--


--===============2168632211235121268==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Piranha-list mailing list
[email protected]
https://www.redhat.com/mailman/listinfo/piranha-list
--===============2168632211235121268==--