LVS Deployement On CentOS7

What is the Linux Virtual Server?

The Linux Virtual Server is a highly scalable and highly available server built on a cluster of real servers, with the load balancer running on the Linux operating system. The architecture of the server cluster is fully transparent to end users, and the users interact as if it were a single high-performance virtual server.

Environment Setup:-

, LVS Deployement On CentOS7


Installation & Configuraion:-

HTTP packet traffic of the  “eth0” on LVS server are forwarded  on Both Backend web server

  1. Install ipvsadm
# yum install ipvsadm –y
  1. Enable the NAT forwarding setting as
# echo 'net.ipv4.ip_forward = 1' >> /etc/sysctl.conf

#sysctl -p

# touch /etc/sysconfig/ipvsadm

 # systemctl start ipvsadm

 # systemctl enable ipvsadm


  1. Configure Load Balancing:-
# ipvsadm -C                      (clear tables)

#ipvsadm -A -t -s wlc  (add virtual service)
  1. Add backend Servers
         # ipvsadm -a -t -r –m

         # ipvsadm -a -t -r –m
  1. Confirm Tables
# ipvsadm –l

IP Virtual Server version 1.2.1 (size=4096)Prot LocalAddress:Port Scheduler Flags  -> RemoteAddress:Port           Forward Weight ActiveConn InActConnTCP  your_FQDN:http wlc  ->               Masq    1      0          0  ->               Masq    1      0          0


WLC:  Weighted Least-Connection
assigns more jobs to servers with fewer jobs and relative to the real servers’ weight (Ci/Wi). This is the default.

Leave a Reply

Your email address will not be published. Required fields are marked *