Rate This Document
Findability
Accuracy
Completeness
Readability

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).
  1. Check whether ip_vs is loaded to the kernel module.
    1
    lsmod | grep ip_vs
    

    If no command output is displayed, ip_vs is not loaded to the kernel module.

  2. Configure the LVS service.

    Specify the local virtual IP address, RS IP address, and port number.

    1. Open the lvs_config.sh file.
      1
      vim lvs_config.sh
      
    2. 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
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  3. Run the following script on LVS.
    1
    sh lvs_config.sh
    
  4. View the configuration.
    1
    ipvsadm -Ln
    

  5. Configure the RS (Nginx and ATS deployment server).

    Log in to the RS in SSH mode.

    1. Open the rs_config.sh file.
      1
      vim rs_config.sh
      
    2. 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
    3. Press Esc, type :wq!, and press Enter to save the file and exit.
  6. Run the script on the RS.
    1
    sh rs_config.sh