一、搭建的坏境
DR 服务器:192.168.111.50
web 服务器1:192.168.111.51
web 服务器2:192.168.111.53
vip(虚拟回环):192.168.111.188
客户端:192.168.111.200
二、配置负载调度器
systemctl stop firewalld.service
setenforce 0
[root@localhost ~]
[root@localhost ~]
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
[root@localhost ~]
[root@localhost network-scripts]
[root@localhost network-scripts]
NAME=ens33:0
DEVICE=ens33:0
IPADDR=192.168.111.188
NETMASK=255.255.255.255
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
net.ipv4.ip_forward = 0
net.ipv4.conf.all.send_redirects = 0
net.ipv4.conf.default.send_redirects = 0
net.ipv4.conf.ens33.send_redirects = 0
[root@localhost network-scripts]
[root@localhost ~]
[root@localhost ~]
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost network-scripts]
IP Virtual Server version 1.2.1 (size=4096)
Prot LocalAddress:Port Scheduler Flags
-> RemoteAddress:Port Forward Weight ActiveConn InActConn
TCP localhost.localdomain:http rr
-> 192.168.111.51:http Route 1 0 0
-> 192.168.111.53:http Route 1 0 0
[root@localhost network-scripts]
三、节点服务器配置
节点1
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
DEVICE=lo:0
IPADDR=192.168.111.188
NETMASK=255.255.255.255
NETWORK=127.0.0.0
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
/usr/sbin/route add -host 192.168.111.188 dev lo:0
[root@localhost network-scripts]
[root@localhost network-scripts]
-rwxr-xr-x. 1 root root 484 11月 17 16:56 /etc/rc.d/rc.local
[root@localhost network-scripts]
[root@localhost network-scripts]
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
节点2
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost ~]
[root@localhost network-scripts]
[root@localhost network-scripts]
DEVICE=lo:0
IPADDR=192.168.111.188
NETMASK=255.255.255.255
NETWORK=127.0.0.0
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
[root@localhost network-scripts]
/usr/sbin/route add -host 192.168.111.188 dev lo:0
[root@localhost network-scripts]
[root@localhost network-scripts]
-rwxr-xr-x. 1 root root 484 11月 17 16:56 /etc/rc.d/rc.local
[root@localhost network-scripts]
[root@localhost network-scripts]
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