Linux Virtual Server Load Balancer clustering as IP load Balancer high availability clustering on RHEL/CentOS/Scientific Linux/Oracle Linux 6/5 to configure 5 Nodes Load Balancer.
LVS(Linux Virtual Server) Components

  • Piranha is the IP Load Balancing solution in Linux.
  • Piranha provides the ability to load?balance incoming IP network requests across a pool of servers.
  • IP Load Balancing with Piranha is based on open source Linux Virtual Server (LVS) technology.
  • Piranha is strictly a software HA implementation which is the cluster package and the GUI administrative tool for the cluster.
Pulse
  • This is the controlling process which starts all other daemons related to LVS routers.
  • It then reads the configuration file /etc/sysconfig/ha/lvs.cf. On the active router, pulse starts the LVS daemon.
  • On the backup router, pulse determines the health of the active router by executing a simple heartbeat at a user configurable interval.
  • If the active router fails to respond after a user?configurable interval, it initiates failover.
LVS
  • The lvs daemon runs on the active LVS router once called by pulse. It reads the configuration file /etc/sysconfig/ha/lvs.cf, calls the ipvsadm utility to build and maintain the IPVS routing table.
IPVSadm
  • This service updates the IPVS routing table in the kernel. The lvs daemon sets up and administers
  • LVS by calling ipvsadm to add, change, or delete entries in the IPVS routing table
Nanny
  • The nanny monitoring daemon runs on the active LVS router
Piranha Configuration Tool
  • Piranha is the IP Load Balancing solution in Linux.
  • Piranha provides the ability to load?balance incoming IP network requests across a pool of servers.
  • IP Load Balancing with Piranha is based on open source Linux Virtual Server (LVS) technology.
  • Piranha is strictly a software HA implementation which is the cluster package and the GUI administrative tool for the cluster.

LVS(Linux Virtual Server) Requirements to configure 5 Nodes Load Balancer


Requirements
  • Two nodes for LVS (Piranha Pulse nannay Ipvsadm) as Load balancer
  • Three nodes for Web servers can be multiple upto your requirement
Package
  • piranha*.rpm
  • pulse*
  • sshd*
Port
  • piranha-3636
  • pulse-20222
  • sshd-22
Configuration files
  • /etc/sysconfig/ha/lvs.cf
Services
  • piranha?gui
  • pulse
  • sshd

LVS(Linux Virtual Server) Cluster Diagram

LVS-Cluster-Diagram

Configuration host entries

Create a host file and copy in all machine
# vi /etc/hosts
Add the following Lines
127.0.0.1 localhost.localdomain localhost
192.168.1.100 lvsroute1
192.168.1.200 lvsroute2
192.168.1.10 web10
192.168.1.20 web20
192.168.1.30 web30
save and exit using :wq

Steps for configuration of Linux Virtual Server Load Balancer Clustering on CentOS/RHEL 6/5 to configure 5 Nodes Load Balancer

Step-I(Generate ssh pvt and public key and copy in all servers)
# ssh-keygen -t rsa
# ssh-keygen -t dsa
# cd /root/.ssh/
# cat *.pub > authorized_keys
#scp -r /root/.ssh/ www10:/root/
#scp -r /root/.ssh/ www20:/root/
#scp -r /root/.ssh/ www30:/root/
#scp -r /root/.ssh/ lvsroute1:/root/
#scp -r /root/.ssh/ lvsrouter2:/root/
#ssh-keyscan -t dsa lvsroute1 lvsroute2 www1 www20 www30
#ssh-keyscan -t rsa lvsroute1 lvsroute2 www1 www20 www30
Step-II(Configure time server and make all server it client(NTP server and NTP client).
Part-A(Configuration for NTP server)
# vim /etc/ntp.conf
Add the following Lines
restrict 127.0.0.1
server 192.168.1.T # local clock
save and exit using :wq
# service ntpd restart
Part-B(NTP Client side)
#vim /etc/ntp.conf
Add the following Lines
#restrict 127.0.0.1
#restrict -6 ::1
server 192.168.1.T ##Put Server IP here##
save and exit using :wq
# service ntpd restart
# ntpdate -u 192.168.1.T
Copy and do same in all nodes
Step-III(Install piranha pkg in LVS router)
# yum install piranha*
# vim /etc/sysconfig/ha/lvs.cf
Step-IV(Login as piranha users supply password)

 

Step-V(Configure on lvsroute1)

Step-VConfigure-on-lvsroute1-A
Step-VConfigure-on-lvsroute1-B
Step-VConfigure-on-lvsroute1-C

Step-VI(Check failover conditions)

Now put off one route see with public ip Still site is visible or not. Similarly put of web server an check the availability of web site from public ip
Congratulations now you have installed and Configured the Linux Virtual Server Load Balancer Clustering on CentOS/RHEL 6/5
At Boot time, the daemon is started by the /etc/rc.d/init.d/pulse script.