The DR mode of the LVS load Balancing cluster
First, the environment
4 Virtual machines: 1 Client, 1 directorserver, 2 realserver. The IP addresses are as follows:
client:192.168.12.22
ds:vip:192.168.12.100,dip:192.168.12.10
realserver1:192.168.12.80
realserver2:192.168.12.81
Second, installation configuration Realserver
RealServer1:
Yum-y Install httpd
Chkconfig httpd on
echo "RealServer1" >>/var/www/html/index.html
Service httpd Start
/sbin/ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up
/sbin/route add-host $VIP Dev lo:0
echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
Sysctl-p
RealServer2:
Yum-y Install httpd
Chkconfig httpd on
echo "RealServer2" >>/var/www/html/index.html
Service httpd Start
/sbin/ifconfig lo:0 $VIP broadcast $VIP netmask 255.255.255.255 up
/sbin/route add-host $VIP Dev lo:0
echo "1" >/proc/sys/net/ipv4/conf/lo/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/lo/arp_announce
echo "1" >/proc/sys/net/ipv4/conf/all/arp_ignore
echo "2" >/proc/sys/net/ipv4/conf/all/arp_announce
Sysctl-p
Three, installation configuration Directorserver
/sbin/ifconfig eth0:1 $VIP broadcast $VIP netmask 255.255.255.255 up
/sbin/route add-host $VIP Dev eth0:1
Yum-y Install Ipvsadm
Ipvsadm-a-T 192.168.12.100:80-s WLC
Ipvsadm-a-T 192.168.12.100:80-r 192.168.12.80-g-W 1
Ipvsadm-a-T 192.168.12.100:80-r 192.168.12.81-g-W 1
Service Ipvsadm Save
Ipvsadm-l-N
Parameter description:
-A Add Cluster service;
-T TCP protocol;
-s specifies the scheduling algorithm;
-G is specified as Dr mode;
-W weight;
Iv. Client Access Testing
Ab-c 10-n http://192.168.12.100/index.html
This article is from the "Square Hill" blog, please be sure to keep this source http://63638790.blog.51cto.com/513514/1620001
The DR mode of the LVS load Balancing cluster