LVS: Full name Linux virtual server, is a very much load Balancing cluster software, as the work on the TCP four layer of software, so that it can dispatch a very many applications, and performance than the application layer of load balancing software better.
Prepare the lab environment:
VMware Workstation 10.0
Os:centos 6.4
The experiment topology is as follows:
650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/6E/B1/wKiom1WCqC2TVVIuAAH0lG6vy0s845.jpg "title=" Lvs.jpg "alt=" Wkiom1wcqc2tvviuaah0lg6vy0s845.jpg "/>
Director's configuration
Configuring Dip and vipifconfig eth0 192.168.1.115/24 upifconfig eth0:0 192.168.1.110/24 Up off iptables because LVS cannot be configured with iptables generic Server iptables stop local disc yum source installation ipvsadmvim /etc/yum.repos.d/ cdrom.repo name=centos 6.4 baseurl=file:///mnt enabled=1 gpgcheck=0 mount disc to/mnt directory mount /dev/cdrom /mnt install Ipvsadmyum install ipvsadmipvsadmin command to use add a RR for the Cluster service # ipvsadm -a -t 192.168.1.110:80 -s rr         RR represents the scheduling algorithm Add rs # ipvsadm -a -t 192.168.1.110:80 in the Cluster service -r 192.168.1.116 -g # ipvsadm -a -t 192.168.1.110:80 -R 192.168.1.117 -g -g means Dr Model test Open http://192.168.1.110/in the browser Index.html View the cluster configuration Ipvsadm -l -n view the current number of connections ipvsadm -l -n -c
Realserver Configuration (2 RS configuration as except eth0 IP address) Configure IP address ifconfig eth0 192.168.1.116/24 Up in order to make the MAC address of the RS virtual IP not be advertised, the kernel parameters of Linux need to be set first Echo 1 > /proc/sys/net/ipv4/conf/lo/arp_ignoreecho 2 > /proc/sys/net/ipv4/conf/lo/arp_announceecho 1 > /proc/sys/net/ipv4/ Conf/all/arp_ignoreecho 2 > /proc/sys/net/ipv4/conf/all/arp_announce Kernel parameter Interpretation arp_ignore: defines the response level when an ARP request is received; 0: A response is given if the local configuration has a corresponding address; 1: The response is only given when the requested destination address is configured on the interface to which the request arrives; arp_ Announce: Defines the level of notification when you advertise your own address outward; 0: Advertise any addresses on any of the local interfaces outward; 1: Attempt to advertise only addresses to the target network that match its network;             2: Advertise only to networks that match addresses on the local interface; Configure vip/sbin/ifconfig lo:0 192.168.1.110 broadcast 192.168.1.110 netmask 255.255.255.255 up above broadcast address to ensure VIP does not broadcast out/sbin/route add -host 192.168.1.110 dev lo:0 This host route indicates that the destination address is the address above lo, and when it goes out to lo:0 as its source address because it provides a Web cluster, the installation httpdyum install httpd Close selinux setenfore 0 Test httpd install normal echo "realserver 1" > /var/www/ Html
This article is from the "Linux is belong to You" blog, make sure to keep this source http://jwh5566.blog.51cto.com/7394620/1664076
Step by Step build LVS-DR model lb cluster (i)