Deploying the Load Balancing Node (LVS)
- For details about how to use and deploy LVS, see LVS Deployment Guide. This section describes only the related settings.
- LVS is deployed in DR mode. Ensure that the IP addresses of LVS and the backend real server (RS) (the server where Nginx and ATS are deployed) are in the same network segment so that they can communicate with each other without using a gateway. Ensure that the kernel modules related to ip_vs are successfully loaded to the Linux Virtual Server (LVS).
- Check whether ip_vs is loaded to the kernel module.
1lsmod | grep ip_vs

If no command output is displayed, ip_vs is not loaded to the kernel module.
- Configure the LVS service.
Specify the local virtual IP address, RS IP address, and port number.
- Open the lvs_config.sh file.
1vim lvs_config.sh - Press i to enter the insert mode and add the following content to the file:
VIP=192.168.100.225 RS1=192.168.100.206 ipvsadm --save > /etc/sysconfig/ipvsadm systemctl start ipvsadm ifconfig enp3s0:0 $VIP broadcast $VIP netmask 255.255.255.255 up route add -host $VIP dev enp3s0:0 echo 1 > /proc/sys/net/ipv4/ip_forward ipvsadm -C ipvsadm -A -t ${VIP}:10001 -s lc ipvsadm -a -t ${VIP}:10001 -r ${RS1}:10001 -g - Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the lvs_config.sh file.
- Run the following script on LVS.
1sh lvs_config.sh - View the configuration.
1ipvsadm -Ln
- Configure the RS (Nginx and ATS deployment server).
Log in to the RS in SSH mode.
- Open the rs_config.sh file.
1vim rs_config.sh - Press i to enter the insert mode and add the following content to the file:
VIP=192.168.100.225 ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up echo 1 > /proc/sys/net/ipv4/conf/all/arp_ignore echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignore echo 2 > /proc/sys/net/ipv4/conf/all/arp_announce echo 2 > /proc/sys/net/ipv4/conf/lo/arp_announce
- Press Esc, type :wq!, and press Enter to save the file and exit.
- Open the rs_config.sh file.
- Run the script on the RS.
1sh rs_config.sh
Parent topic: Component Deployment