Re: Load Balancing Issue - can someone help?
"Ian Walker" <[email protected]>
| Newsgroups | gmane.linux.highavailability.ultramonkey |
|---|---|
| Message-ID | <[email protected]> |
I think I realised what the problem was. Starting with the replies.
1. Had set up masquerading so that the director could deal with the real
servers. My command was:
iptables -t nat -A POSTROUTING -j MASQUERADE -s 192.168.0.0/24
iptables -t nat -A POSTROUTING -j LOG
I also checked the default gateway on the real servers, and they were
pointing to the director.
2. Didn't want to set up http, as ftp/telnet should work just as well. I
checked this morning and found that telnet was working. I tried ftp with
the following config:
virtual = 172.20.12.231:21
real = 192.168.0.2:21 masq
real = 192.168.0.3:21 masq
service = ftp
request = "/etc/welcome.msg"
receive = "Welcome"
scheduler = rr
protocol = tcp
checktype = negotiate
now this config looks pretty normal, unfortunately you get a weight of 0
using this. I changed the following line:
service = none
on completion of this and restarting the service, I got a weight of 1. Now,
ftp is working perfectly well. Of course, with rr each connection
alternates between one of the two servers, which is perfectly fine, as it
shows it's working correctly anyhow.
Also, I didn't use persistent = 600 because I'm using "masq" and not "gate"
or "ipip". However, it seems that it's now working fine. The reason being
was that I had two interfaces in the real servers, and eth0 in both machines
were pointing to the 172.20.0.0 network, which most likely meant arp replies
from this could have stopped them working for the 192.168.0.0 network. I
disabled these last night, but didn't test again until this morning. Of
course, now only the 192.168.0.0 on eth1 in both machines is active, and I
can only think this is the reason that they are now working - although I'm
not entirely sure.
I'm certain that my config hasn't changed that much at all, so can only put
it down to this as to why the problem is resolved.
My next test is to see if I can get squid proxy working, which will be a
nice bit of fun!
Many thanks for your input on this.
Regards
Ian Walker
On 09/08/06, Glen Kendell <[email protected]> wrote:
>
> Ian,
>
> May I suggest starting with HTTP just to get it working? Start with
> testing a connection to each real server from the director itself. That
> will at least tell you if you have an issue between your real servers and
> the director or not. For session-oriented protocols like telnet and ftp,
> you may want to add persistent=600 (or whatever value) to your
> ldirectord.cf.
>
> - Glen
>
>
>
> On 8/9/06 6:35 AM, "Ian Walker" <[email protected]> wrote:
>
> I've tried that too, just realised the port 22 was when I was testing
> ssh!!! Doh. Sorry about that. With ftp I don't get anything at all, no
> results. The only time I've managed to get some sort of results on the
> ldirectord is when using telnet. But even that isn't 100% successful, as
> you can just see the incoming packets, and inactive session, nothing goes
> active, and no packets are sent back outbound.
>
>
> Ian
>
> On 09/08/06, *Glen Kendell* <[email protected]> wrote:
>
> Ian,
>
> Try port 21. :-)
>
> - Glen
>
>
>
> On 8/9/06 5:32 AM, "Ian Walker" <[email protected]> wrote:
>
> I checked my config, and I'm not sure why it was reporting zero the first
> time around. I now have a weight of 1 for both entries, shown below:
>
> IP Virtual Server version 1.0.8 (size=65536)
> Prot LocalAddress:Port Scheduler Flags
> -> RemoteAddress:Port Forward Weight ActiveConn InActConn
> TCP 172.20.12.231:22 <http://172.20.12.231:22> <http://172.20.12.231:22>
> <http://172.20.12.231:22> <http://172.20.12.231:22> rr
> -> 192.168.0.3:22 <http://192.168.0.3:22> <http://192.168.0.3:22>
> <http://192.168.0.3:22> <http://192.168.0.3:22> Masq 1
> 0 0
> -> 192.168.0.2:22 <http://192.168.0.2:22> <http://192.168.0.2:22>
> <http://192.168.0.2:22> <http://192.168.0.2:22> Masq 1
> 0 0
>
> however, I still get the same end result of no connection. I'm new to
> this, but I based my config on the sample ldirectord.cf
> <http://ldirectord.cf> <http://ldirectord.cf> <http://ldirectord.cf><http://ldirectord.cf> file to get as far as I have now.
>
>
> Regards
>
>
> Ian
>
>
>
> On 09/08/06, *Andersson Mattias* < [email protected]
> <mailto:[email protected]> <[email protected]> > wrote:
> Hi Ian
>
> Having a look at:
> IP Virtual Server version 1.0.8 (size=65536)
> Prot LocalAddress:Port Scheduler Flags
> -> RemoteAddress:Port Forward Weight ActiveConn InActConn
> TCP 172.20.12.231:22 <http://172.20.12.231:22> <http://172.20.12.231:22>
> <http://172.20.12.231:22> <http://172.20.12.231:22> rr
> -> 192.168.0.3:22 <http://192.168.0.3:22> <http://192.168.0.3:22>
> <http://192.168.0.3:22> <http://192.168.0.3:22> Masq 0
> 0 0
> -> 192.168.0.2:22 <http://192.168.0.2:22> <http://192.168.0.2:22>
> <http://192.168.0.2:22> <http://192.168.0.2:22> Masq 0
> 0 0
>
>
>
> The weight 0 indicates that your connection verification is not working
> and that the real servers therefore are disabled.
>
> Have a look at your ldirectord configuration and fix this.
>
>
> /Mattias
>
> ________________________________________
> From: [email protected] [
> mailto:[email protected]<[email protected]>
> <mailto:[email protected]><[email protected]>
> <mailto:[email protected]><[email protected]>
> <mailto:[email protected]><[email protected]> ] On Behalf Of Ian Walker
>
>
> Sent: Wednesday, August 09, 2006 12:42 PM
> To: [email protected]
> Subject: Load Balancing Issue - can someone help?
>
> Have been trying to get my config to work, using ftp but it doesn't seem
> to work on RHEL3U7. Here's my config:
>
> virtual = 172.20.12.231:22 <http://172.20.12.231:22><http://172.20.12.231:22>
> <http://172.20.12.231:22> <http://172.20.12.231:22>
> real = 192.168.0.2:22 <http://192.168.0.2:22> <http://192.168.0.2:22>
> <http://192.168.0.2:22> <http://192.168.0.2:22> masq
> real = 192.168.0.3:22 <http://192.168.0.3:22> <http://192.168.0.3:22>
> <http://192.168.0.3:22> <http://192.168.0.3:22> masq
>
>
> service = ftp
> request = "/etc/welcome.msg"
> receive = "Welcome"
> login = "anonymous"
> passwd = "[email protected]"
> scheduler = rr
> protocol = tcp
> checktype = negotiate
>
> I've validated that it's running OK using "ipvsadm -ln" and it shows the
> following results:
>
> IP Virtual Server version 1.0.8 (size=65536)
> Prot LocalAddress:Port Scheduler Flags
> -> RemoteAddress:Port Forward Weight ActiveConn InActConn
> TCP 172.20.12.231:22 <http://172.20.12.231:22> <http://172.20.12.231:22>
> <http://172.20.12.231:22> <http://172.20.12.231:22> rr
> -> 192.168.0.3:22 <http://192.168.0.3:22> <http://192.168.0.3:22>
> <http://192.168.0.3:22> <http://192.168.0.3:22> Masq 0 0 0
> -> 192.168.0.2:22 <http://192.168.0.2:22> <http://192.168.0.2:22>
> <http://192.168.0.2:22> <http://192.168.0.2:22> Masq 0 0 0
>
>
>
> and everytime I try to connect with FTP it fails with connection refused.
> I did change the config so that it was configured for telnet just to test,
> so my config was:
>
>
> virtual = 172.20.12.231:23 <http://172.20.12.231:23><http://172.20.12.231:23>
> <http://172.20.12.231:23> <http://172.20.12.231:23>
> real = 192.168.0.2:23 <http://192.168.0.2:23> <http://192.168.0.2:23>
> <http://192.168.0.2:23> <http://192.168.0.2:23> masq
> real = 192.168.0.3:23 <http://192.168.0.3:23> <http://192.168.0.3:23>
> <http://192.168.0.3:23> <http://192.168.0.3:23> masq
>
>
> service = none
> request = "/etc/welcome.msg"
> receive = "Welcome"
> scheduler = rr
> protocol = tcp
> checktype = negotiate
>
> and this time when I ran the "ipvsadm -ln --connection" command, I got
> these results:
>
> IPVS connection entries
> pro expire state source virtual destination
> TCP 00:59 SYN_RECV 172.20.12.17:41271 <http://172.20.12.17:41271><http://172.20.12.17:41271>
> <http://172.20.12.17:41271> <http://172.20.12.17:41271> 172.20.12.231:23
> <http://172.20.12.231:23> <http://172.20.12.231:23>
> <http://172.20.12.231:23> <http://172.20.12.231:23> 192.168.0.2:23
> <http://192.168.0.2:23> <http://192.168.0.2:23> <http://192.168.0.2:23><http://192.168.0.2:23>
>
>
>
> so is kind of looking better. I then checked the stats to find:
>
> IP Virtual Server version 1.0.8 (size=65536)
> Prot LocalAddress:Port Conns InPkts OutPkts InBytes OutBytes
> -> RemoteAddress:Port
> TCP 172.20.12.231:23 <http://172.20.12.231:23> <http://172.20.12.231:23>
> <http://172.20.12.231:23> <http://172.20.12.231:23> 1 3 0 180 0
> -> 192.168.0.2:23 <http://192.168.0.2:23> <http://192.168.0.2:23>
> <http://192.168.0.2:23> <http://192.168.0.2:23> 1 3 0 180 0
> -> 192.168.0.3:23 <http://192.168.0.3:23> <http://192.168.0.3:23>
> <http://192.168.0.3:23> <http://192.168.0.3:23> 0 0 0 0 0
>
>
>
> so I'm not entirely sure why it's not working as the connection just sits
> there trying to connect with telnet, and nothing else happens. I've
> installed the relevant packages for the ldirector as well as the
> arptables_jf package for RHEL3.
>
> The ldirector has been configured with two network cards. The main network
> being 172.20.12.231 <http://172.20.12.231> <http://172.20.12.231>
> <http://172.20.12.231> <http://172.20.12.231> . This ip is assigned to
> eth0. The other card, eth1 has been configured with 192.168.0.1
> <http://192.168.0.1> <http://192.168.0.1> <http://192.168.0.1><http://192.168.0.1>
> <http://192.168.0.1> <http://192.168.0.1> .
>
> The two servers running ftp have been configured with 192.168.0.2
> <http://192.168.0.2> <http://192.168.0.2> <http://192.168.0.2><http://192.168.0.2> and
> 192.168.0.3 <http://192.168.0.3> <http://192.168.0.3>
> <http://192.168.0.3> <http://192.168.0.3> . Of course, with ftp there was
> nothing, no connection or no stats, that's why I configured with telnet,
> just to see if anything would show.
>
>
>
> Hope I've not sent this to the wrong place, am quite interested in getting
> this working.
>
> Regards
>
>
> Ian
>
>
> --
> Ultra Monkey - http://www.ultramonkey.org/ <http://www.ultramonkey.org/><http://www.ultramonkey.org/>
>
> To UNSUBSCRIBE, email to [email protected], with a body:
> unsubscribe ultramonkey-users [email protected]
> <mailto:[email protected]> <[email protected]>
>
> where "[email protected]" is YOUR email address.
>
>
>
>
>
>
> --
> Glen Kendell
> Martian Fireworks Security
> 206.965.8583 direct
> 206.399.3510 cell
> [email protected]
>