LB (load balance) LVS for load-balanced clusters

Source: Internet
Author: User

LB (load balance) Load Balancer cluster

Principle: When a user's request comes in, it is sent directly to the dispatcher (Director server), which then distributes the user's request intelligently and evenly to the backend really server (real server) according to the pre-set algorithm. If different machines may request data differently, in order to avoid this situation, use shared storage to ensure that all users request the same data.


Common open source software for load balancing is: lvs,keepalived,haproxy,nginx,apache,heartbeat

Commercial hardware load Devices: F5,NETSCALER,RADWARE,A10

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M02/79/AE/wKiom1aYUEXgIkafAABrBCZt0VY048.png "title=" 115112w1we1x4e5ueewzrd.png "alt=" Wkiom1ayuexgikafaabrbczt0vy048.png "/>


First, LVs is a shorthand for Linux virtual server, and is a virtualized cluster system of servers, andLVs is a platform that can be Unix/linux an open source project for load Balancing clusters, the LVS architecture is logically divided into the scheduling layer (Director server), the cluster layer (real server), and the shared storage


1, LVS has the following three modes of operation:

Concept:

Dip (Director IP) Dispatcher Ip,nat mode must have a public IP

VIP (virtual IP) IP, used in Tun and Dr Mode, need to configure both the re-distributor and the backend on the real server

RIP (real IP) backend is really IP, in Tun and Dr Mode, RIP is public IP


(1) Nat mode

The scheduler modifies the requested destination IP, which is the VIP address, to the real server's IP, and the returned data is dispatched by the scheduler, which then modifies the source address to the VIP

650) this.width=650; "src=" Http://s5.51cto.com/wyfs02/M01/79/AF/wKioL1aYX6zCpb7ZAAFEOkQiaIE376.jpg "title=" Nat.jpg "alt=" Wkiol1ayx6zcpb7zaafeokqiaie376.jpg "/>

(2) Tun mode

The scheduler encapsulates the requested packet encryption over the IP tunnel to the back-end real server, and real server returns the data directly to the client without the scheduler

(3) Dr mode

The scheduler modifies the destination MAC address of the requested packet to the MAC address of the real server and returns to the client with no time over the scheduler.

650) this.width=650; "src=" http://s4.51cto.com/wyfs02/M00/79/AF/wKioL1aYX5mSWLPJAAFPBeEBYsY000.jpg "title=" dr.jpg "alt=" Wkiol1ayx5mswlpjaafpbeebysy000.jpg "/>

2, to the user's request to dispatch to the back-end of the RS, is required by the scheduling algorithm to achieve, LVS commonly used the following scheduling algorithms:

Fixed scheduling algorithm: Rr,wrr,dh,sh

Dynamic Scheduling algorithm: WLC,LC,LBLC,LBLCR


(1) RR round call scheduling (Round Robin), this algorithm is the simplest, regardless of the RS backend configuration and processing power, balanced distribution down


(2) WRR weighted round called (Weight Round Robin), more than the above algorithm a weight concept, you can set the weight of the RS, the higher the weight, then the more requests distributed, the weight range of 0-100


(3) LC Minimum Link (least connection), the algorithm will be based on the back end of the RS connection number to decide who to send the request, such as RS1 connection number less than RS2 connection, then request priority to send to RS1


(4) WLC weighted least link (Weighted Least connecttion) has one more weight than the least-link algorithm


(5) Dh Purpose address hash dispatch (destination hashing) Find a static hash table with the destination address as the keyword to obtain the required RS

(6) SH Source Address hash dispatch (source hashing) find a static hash table with the source address as the keyword to obtain the required RS


(7) LBLC minimum number of connections scheduling (least-connection), Ipvs table stores all active connections. LB compares the connection request to the currently least connected RS


(8) LBLCR Local-based minimum connections with replication: improvements to the LBLC algorithm

This article is from the "Daixuan" blog, make sure to keep this source http://daixuan.blog.51cto.com/5426657/1735230

LB (load balance) LVS for load-balanced clusters

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.