LVS
lvs-users
Google
 
Web LinuxVirtualServer.org

load balancing using ldirectord

To: "Lvs-Users" <lvs-users@xxxxxxxxxxxxxxxxxxxxxx>
Subject: load balancing using ldirectord
From: "Vic Berdin" <vic@xxxxxxxxxxx>
Date: Fri, 19 Nov 2004 20:14:25 +0800
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?

 

 

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?

 

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".

 

Any insights, clarification, etc are very much welcome.

 

 

TIA - Vic

 


<Prev in Thread] Current Thread [Next in Thread>