LVS DR Piranha (Director & Realserver server on same Machine)
Anil Pillai <[email protected]> Fri, 22 Jan 2010 11:44:08 +0530
| Newsgroups | gmane.comp.programming.load-balancing.general |
|---|---|
| Message-ID | <[email protected]> |
--===============0502615717== Content-Type: multipart/alternative; boundary=000e0cd5c9d839306d047dbabab4 --000e0cd5c9d839306d047dbabab4 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 and Apache is 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 on 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 the same host (10.50.57.40). Does anyone know how to resolve this ? --000e0cd5c9d839306d047dbabab4 Content-Type: text/html; charset=windows-1252 Content-Transfer-Encoding: quoted-printable <div class=3D"gmail_quote"> <div>Hi,</div> <div>=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=A0 </font>= <span style=3D"COLOR: #1f497d"><font size=3D"3">iptables enrty on Real serv= ers like this (iptables =96t nat =96A PREROUTING =96p tcp =96d <VIP> = --dport <port> -j REDIRECT).</font></span>=20 <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 and Apach= e is installed 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 = -> 10.50.57.55 (VIP) -> 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 & 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 on 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 t= he same 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=A0know=A0how t= o=A0resolve this=A0?</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></div></div><br> --000e0cd5c9d839306d047dbabab4-- --===============0502615717== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ lb-l mailing list [email protected] http://vegan.net/mailman/listinfo/lb-l Searchable Archive: http://vegan.net/lb/archive http://lbdigest.com Load Balancing Digest http://lbwiki.com Load Balancing Wiki --===============0502615717==--