lvs-kiss.conf - Global configuration for lvs-kiss.
lvs-kiss has a syntax which very much resembles the Apache configuration files. The Virtual server and the working nodes (RealServers) are arranged in hierarchy which should be quite intuitive.
There are virtualservers and realservers. A virtualserver is a virtual service which is load-balanced on servereal realservers. You should create virtualservers and populate these with realservers.
See the LoadMeasure and LoadCommand entries for more information.
If you use dynamic load-balancing without setting the LoadCommand, the test is timed and the time is used as a key when distributing incoming connections.
Prefix the command with the type of execution which is to be done. ``perl:'' for perl-test and ``sh:'' for shell commands.
For mail-exchanges, I have used the LRRD client to aqiure the size of the mail-queue remote. LRRD spits out the size if you do a
``(echo 'fetch exim_mailqueue';echo .)| nc mail-exchange 4949''
When set up this way lvs-kiss will direct most of the incoming connections to the mail-exchanges with the least queue.
This configuration sets up a virtal service, web.foo.com:80, which is loadbalanced between two realservers, web1 and web2.
<VirtualServer web.foo.com:80> ServiceType tcp Scheduler wrr DynamicScheduler 1
<RealServer web1.foo.com:80> Test wget --timeout=10 http://web1.foo.com/ping.pl </RealServer> <RealServer web2.foo.com:80> Test wget --timeout=10 http://web2.foo.com/ping.pl </RealServer>
</VirtualServer>
<VirtualServer mx.foo.com:25> ServiceType tcp
Scheduler wlc
DynamicScheduler 1
# The measurements are put in a queue in order in order to reduce # the effect of a single inaccurate measurements. The average is used # to calculate weight.
# The longer the queue the less dynamic will the re-balancing be. # However; if the queue is short - the re-balancing will be very # labile and there will be a risk of oscillation.
QueueSize 4
# if you use time as a key for re-balancing then consider the # situation where one server responds in 0.01 seconds and the other # responds in 0.02. If you still want to distribute evenly between # there add some fuzz, e.g. 0.1. The response-times will then be 0.01 + # 0.1 and 0.02 + 0.1. # This will give you a even distribution unless one of the server # actually slows down a bit
Fuzz 0.05
# Here are the RIPs, the realservers, the working class.
<RealServer smtp-worker1.foo.com:25>
PacketForwardingMethod gatewaying
# here we use Netsaint plugins.
Test /usr/lib/netsaint/plugins/check_smtp -t 10 -H smtp-worker1.foo.com
LoadCommand sh:ruptime|grep -e ^smtp-worker1
LoadRX load\s+(\d+\.\d+)
RunOnFailure "echo smtp-worker1 has failed | mail admin@localhost"
RunOnRecovery "echo smtp-worker1 is back online | mail admin@localhost"
</RealServer>
<RealServer smtp-worker2.foo.com:25>
PacketForwardingMethod gatewaying
Test /usr/lib/netsaint/plugins/check_smtp -t 10 -H smtp-worker1.foo.com
LoadCommand sh:ruptime|grep -e ^smtp-worker1
LoadRX load\s+(\d+\.\d+)
Test /usr/lib/netsaint/plugins/check_smtp -t 10 -H smtp-worker2.foo.com
LoadCommand sh:ruptime|grep -e ^smtp-worker2
LoadRX load\s+(\d+\.\d+)
RunOnFailure "echo smtp-worker2 has failed | mail admin@localhost"
RunOnRecovery "echo smtp-worker2 is back online | mail admin@localhost"
</RealServer>
</VirtualServer>
Per Andreas Buer <perbu (at) linpro.no>
Report bugs to the author.
Copyright (c) 2002 Per Andreas Buer / Linpro AS.
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
ipvsadm (8), lvs-kiss (8)