In a cluster in DR mode, the LVS load scheduler is used as the access portal of the cluster, but not as a gateway; all nodes in the server pool are connected to the Internet respectively, and the Web response packets sent to the client do not need to be scheduled by the LVS load . device .
Step 1: Turn off the firewall and selinux
systemctl stop firewalld
iptables -F
setenforce 0
The second step is to configure the scheduler
yum -y install ipvsadm
yum -y install ipvsadm
ifconfig ens32:0 192.168.200.254 netmask 255.255.255.0
ifconfig ens32:0
The third step is to allocate
ipvsadm -A -t 192.168.200.254:80 -s rr
ipvsadm -a -t 192.168.200.254:80 -r 192.168.200.113:80 -g -w 1
The fourth step, modify the node machine
Configure virtual interfaces
ifconfig lo:0 192.168.200.254 netmask 255.255.255.255
ifconfig lo:0
The fifth step, node machine installation
yum -y install httpd
Add test page echo "...." > /var/www/html/index.html
systemctl start httpd
The sixth step, adjust the parameters of the debugger machine
Write under vim /etc/sysctl.conf
---------------------------------------------------------
net.ipv4.conf.all.arp_ignore = 1
net.ipv4.conf.all.arp_announce = 2
net.ipv4.conf.default.arp_ignore = 1
net.ipv4.conf.default.arp_announce = 2
net.ipv4.conf.lo.arp_ignore = 1
net.ipv4.conf.lo.arp_announce = 2
--------------------------------------------------------------
Enable: sysctl -p
You can test it in the browser, enter it with the net test method
Seven steps
to query the load status
ipvsadm -Lnc
Reprinted in: https://www.cnblogs.com/123456likun/p/11606873.html