The DR mode of the LVS load Balancing cluster

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.