Load Balancing with LVS-TUN Part 1
The following blog post has all the configuration files needed to properly setup the load balancer aspect of lvs-tun. I have gone through and commented the config files so that there is an explanation behind many of the important variables that are needed in order to get LVS-TUN working properly. There are several steps that need to be completed which I’ve listed below. Please follow them in order.
*Please note, I will be adding the lvs-tun web node article next – I’m just working on the formatting.
Table of Contents
1. Prerequisites
2. Shared IP
3. Add Repositories
4. Installing Pulse
5. The lvs.cf file
6. sysctl parameters
7. iptables
8. Start the Service
9. Next Steps
Prerequisites
• This document assumes you have already built your load balancers and your web nodes, and you have at least 3 servers.
• This document also assumes you are running CentOS 5.5/RHEL 5.5 or greater. This has not been tested on any other Linux Distribution at this time.
Shared IP
First, you will want to add a shared IP Address without config to the primary load balancer. The IP address should then be shared with the load balancer and ALL of the web servers. I recommend getting all of the web servers standard packages (apache, php, etc.) setup PRIOR to setting up the load balancer. We will cover the lvs-tun web node configuration in a different article linked at the bottom of this page.
Add Repositories
You will want to add the EPEL and IUS repositories to your servers. You can do so by running the following commands ::
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/epel-release-1-1.ius.el5.noarch.rpm
rpm -Uvh http://dl.iuscommunity.org/pub/ius/stable/Redhat/5/x86_64/ius-release-1.0-6.ius.el5.noarch.rpm
yum -y update
Installing Pulse
Next, you will want to install pirahna. While we will not actually use pirahna, it contains the service (pulse) necessary to make lvs-tun work. You will also want to install the standard installation packages at this time (sysstat, ntpd, etc). You will do this by running the following command ::
yum -y install piranha sysstat ntp telnet curl
Once completed, enable the service to start at boot. Note, though we installed pirahna, we are actually using the ‘pulse’ service. Pirahna itself is not used at all. ::
chkconfig pulse on
chkconfig ntpd on
chkconfig sysstat on





February 5th, 2011 on 2:26 pm
New Blog Post – Load Balancing with LVS-TUN Part 1 – http://brianlewis.us/work/load-balancing-with-lvs-tun-part-1/