Components of a Load Balancer

Linux Virtual Server (LVS) system offers a highly-available and scalable solution for production services using specialised routing and load-balancing techniques that can be configured through the Piranha configuration tool.

Required Software

  • CentOS 7
  • Piranha

LVS Cluster

A Linux LVS cluster consists of two basic groups: the LVS routers and the real servers. To prevent a single point of failure, each group will contain two member systems.

As per CentOS documentation, the active router serves two roles in the cluster:

  1. To balance the load on the real servers,
  2. To check the integrity of the services on each of the real servers.

The backup router’s job is to monitor the active router and assume its role in the event of failure.

LVS Components

Pulse: this is the controlling process which starts all other daemons related to LVS routers. At boot time, the daemon is started by the /etc/rc.d/init.d/pulse script. 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.

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, and assigns a nanny process for each configured LVS service. If nanny reports a real server is down, lvs instructs the ipvsadm utility to remove the real server from the IPVS routing table.

nanny: the nanny monitoring daemon runs on the active LVS router. Through this daemon, the active router determines the health of each real server and, optionally, monitors its workload. A separate process runs for each service defined on each real server.

Piranha configuration tool: this is the Web-based tool for monitoring, configuring, and administering an LVS cluster. This is the default tool to maintain the /etc/sysconfig/ha/lvs.cf LVS cluster configuration file.

--

--