Vic Berdin wrote:
Hi,
I'm trying out load balancing using ldirectord on my Linux 2.4.22
environment. I patched my own kernel and built my ipvsadm tool from
patch/source that came from
http://www.linuxvirtualserver.org/software/ipvs.html#kernel-2.4.
My setup only involves two boxes, wherein "heartbeat + ldirectord + my web
service" are both configured on the two boxes. Both boxes have exact similar
"heartbeat + ldirectord + www service" configurations.
What currently works for both boxes are following:
1. Heartbeat (partially; still need to make a default master work) and high
availability
2. Web services are available on both machines (also via their real IPs)
What currently does NOT work are the following
1. Load balancing
2. Election of HA master (if the master node returns, the backup will give
up the VIP)
Here are my configurations:
-----------------------------------------------------
ldirectord.cf:
checktimeout=10
checkinterval=2
autoreload=no
logfile="local0"
quiescent=yes
virtual=192.168.1.87:80
real=192.168.1.45:80 gate 1
real=192.168.1.47:80 gate 1
fallback=127.0.0.1:80 gate 1
request="index.html"
receive="Test Page for Apache Installation"
service=http
scheduler=wlc
protocol=tcp
-----------------------------------------------------
ha.cf
debugfile /var/log/ha-debug
logfile /var/log/ha-log
logfacility local0
keepalive 2
deadtime 10
warntime 10
initdead 10
udpport 694
serial /dev/ttyS0
bcast eth0
auto_failback off
node node1
node node2
-----------------------------------------------------
haresources:
node2 IPaddr::192.168.1.87 ldirectord::/etc/ldirectord.cf
-----------------------------------------------------
Questions:
1. What I observed in load balancing is that the weights that I specified on
ldirectord.cf does not get implemented on the box running the VIP. Below is
a result of my `ipvsdm -L -n` on the currently elected VIP box, 192.168.1.47
(node2):
IP Virtual Server version 1.0.10 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.1.87:80 wlc
-> 192.168.1.45:80 Route 0 0 0
-> 192.168.1.47:80 Local 0 0 0
-> 127.0.0.1:80 Local 1 0 0
Should the weights take effect automatically? Although I can do this using
another script to be called in haresources, but to my understanding, the
weights must be handled automatically by ldirectord. Comments?
I saw this same problem when I was using the request and recieve checks
for http. this would also be why your fallback is set to 1. if any of
the request/recieve worked, you would see a weight in their column, and
a 0 in the fallback IP column. You can test this out by commenting out
the "request" and "recieve" lines in the ldirectord.cf file and putting
in a line for "checktype" similar to below.
real=10.1.2.185:80 gate
real=10.1.2.186:80 gate
service=http
# request="index.html"
# receive="Test Page"
scheduler=rr
protocol=tcp
checktype=connect
All this will do is check that the port is listening, but may give you a
place to start troubleshooting.
2. After manually editing my virtual service rules using ipvsadm to reflect
the following:
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.1.87:80 wlc
-> 192.168.1.45:80 Route 1 0 0
-> 192.168.1.47:80 Local 1 0 0
-> 127.0.0.1:80 Local 1 0 0
And connecting three clients (telnet on VIP using port 80), I get:
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP 192.168.1.87:80 wlc
-> 192.168.1.45:80 Route 1 0 3
-> 192.168.1.47:80 Local 1 1 0
-> 127.0.0.1:80 Local 1 1 0
What seems to happen here is that my two concurrent connections gets
distributed on real servers .47 and its localhost. But for some reason, .45
keeps on rejecting the connection. This is very evident as my third client
always fails to telnet to the VIP. What could be the possible cause for this
failure?
Are you using DR or NAT. it really depends on that. If you are using
DR are the IP addresses on the webserver and the arp_ignore in place?
Localhost should not be answering at all unless all of the realservers
are down. see my note above about the request/recieve checks.
3. And lastly, what heartbeat parameters do I need to set in order for a
node to act as a default master server? Meaning, if it becomes available, it
will automatically inherit the VIP (the backup will let go of the VIP). I
currently have "auto_failback off" on my two boxes, and also tried having
one box set to "on".
I may have an older version. I have an entry in the ha.cf
"nice_failback off" that works like this.you might try this.
I am using: from ultramonkey.
heartbeat: version 1.0.4
Heartbeat generation: 27
Any insights, clarification, etc are very much welcome.
Hope this helps you out a little.
TIA - Vic
|