http://kb.linux-vs.org/api.php?action=feedcontributions&user=Philip+smolen&feedformat=atomLVSKB - User contributions [en]2024-03-29T15:33:43ZUser contributionsMediaWiki 1.26.2http://kb.linux-vs.org/wiki?title=Mini_Mini_Howto&diff=4008Mini Mini Howto2007-05-21T16:46:48Z<p>Philip smolen: New Page</p>
<hr />
<div>== Mini-Mini-Howto ==<br />
<br />
This describes a quick way to get up and going with LVS.<br />
<br />
== Instructions ==<br />
<br />
Start from a precompiled Linux distribution. I was using a combination of Fedora Core 4 and Fedora Core 6, but this should work with any recent version of Linux.<br />
<br />
<br />
<br />
The following will set up the real servers to accept data from the load balancer. I put it into a shell script and added that script to /etc/rc.d/rc.local.<br />
<br />
echo 1 > /proc/sys/net/ipv4/conf/eth0/arp_ignore<br />
<br />
echo 2 > /proc/sys/net/ipv4/conf/eth0/arp_announce<br />
<br />
echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore<br />
<br />
echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce<br />
<br />
ifconfig lo:0 192.168.1.10 netmask 255.255.255.255 broadcast 192.168.1.10 up<br />
<br />
<br />
<br />
One time setup on the load balancer:<br />
<br />
rpm -U /net/shauna/usr/local/share/RPMS/4/ipvsadm-1.24-7.x86_64.rpm<br />
<br />
<br />
<br />
I put the following script on the load balancer, again referenced in /etc/rc.d/rc.local<br />
<br />
ipvsadm --clear<br />
<br />
ipvsadm --add-service --tcp-service 192.168.1.10:80 --scheduler rr<br />
<br />
ipvsadm --add-server --tcp-service 192.168.1.10:80 --real-server bart:80 --gatewaying<br />
<br />
ipvsadm --add-server --tcp-service 192.168.1.10:80 --real-server lisa:80 --gatewaying<br />
<br />
<br />
<br />
That’s all it took. I didn’t recompile anything. My firewall treats 192.168.1.10, the VIP, just like an ordinary machine. Inside the firewall I have a standard switch. Aside from the firewall, all of the machines are using only one NIC and one subnet.<br />
<br />
<br />
<br />
== Rationale ==<br />
<br />
Several years ago I set up an LVS. Recently I did it again. Because of changes in the 2.6 kernel, it was a whole lot easier this time. It was almost trivial. Unfortunately, it took me a long time to dig through the documentation to what I needed.<br />
<br />
All of this information was available on Google, but it was hiding. I can appreciate the older documentation – as I said I worked with this software a long time ago – but some of it has little or no value. How many people, for example, need to use an old version of the kernel? There may be a place for that information, but it should not be the first thing that a potential user sees.</div>Philip smolen