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:-

 

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 38.130.192.68:80 -s wlc  (add virtual service)
  1. Add backend Servers
         # ipvsadm -a -t 38.10.192.68:80 -r 10.0.0.51:80 –m

         # ipvsadm -a -t 38.10.192.68:80 -r 10.0.0.52:80 –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  -> 10.0.0.51:http               Masq    1      0          0  -> 10.0.0.52:http               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 *