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