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.
Installation & Configuraion:-
HTTP packet traffic of the “eth0” on LVS server are forwarded on Both Backend web server
- Install ipvsadm
# yum install ipvsadm –y
- 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
- Configure Load Balancing:-
# ipvsadm -C (clear tables) #ipvsadm -A -t 184.108.40.206:80 -s wlc (add virtual service)
- Add backend Servers
# ipvsadm -a -t 220.127.116.11:80 -r 10.0.0.51:80 –m # ipvsadm -a -t 18.104.22.168:80 -r 10.0.0.52:80 –m
- 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.