NAT type of Load Balancer cluster LVS under Linux

Source: Internet
Author: User

NAT type of Load Balancer cluster LVS under Linux

1. The cluster type is divided into 3 types:

Lb:load balancing, load balancing

Ha:high Availability , High availability

Hp:high performance, high performance

The 2.LB load Balancer four layer LVS type is divided into the following 3 types: (Linux Virtual Server)

NAT: Address Translation

DR: Direct Routing

TUN: Tunnel

2.1.NAT:

The cluster node and director must be in the same IP network;

RIP is usually a private address and is used only for communication between cluster nodes;

The director is located between the client and the real server and is responsible for handling all incoming and outgoing communications;

Realserver must point the gateway to the dip;

Support port mapping;

Realserver can use any OS;

In larger-scale scenarios, director becomes a bottleneck in the system.

2.2.DR: Common Type

The cluster node and director must be in the same physical network;

RIP can use the public network address, to achieve convenient remote management and monitoring;

The Director is only responsible for processing inbound requests, and the response messages are sent directly to the client by Realserver;

Realserver cannot point the gateway to the dip;

Port mappings are not supported;

Support for more cluster nodes than NAT type

2.3.TUN:

Cluster nodes can span the Internet;

RIP must be a public network address;

The Director is only responsible for processing inbound requests, and the response messages are sent directly to the client by Realserver;

Realserver Gateway cannot point to Director;

Only the tunnel-enabled OS can be used for realserver;

Port mappings are not supported;

Support for more cluster nodes than NAT type

3.LVS scheduling Method: Default scheduling method: WLC

3.1. Four methods of static scheduling:

RR: Polling, Round-robin

WRR: Weighted polling, Weight Round-robin

DH: Destination Address hash,destinating Hashing

SH: Source Address Hash,source Hashing

3.2. Six kinds of dynamic scheduling methods:

LC: Minimum Connection least-connection

Active*256+inactive

WLC: Weighted minimum connection Weighted least-connection

(active*256+inactive)/weight

SED: Shortest expected delay shortest excepted delay

(active+1) *256/weight

Nq:never queue

LBLC: Local-based minimum connection locality-based least-connection

LBLCR: Local-based minimum connection with replication capability

locality-based least-connection with Replication scheduling


4.IPVSADM: Manage Cluster service command-line tools

4.1. Managing Cluster Services

Added:-a-t|u|f service-address [-S scheduler]

Clusters of-T:TCP protocols

Clusters of-U:UDP protocols

Service-address:ip:port

-F:FWM: Firewall tag

Service-address:mark number

Modification:-E

Delete:-d-t|u|f service-address

Example: # ipvsadm-a-T 202.100.1.8:80-s RR


4.2. Managing the RS in the Cluster service

Added:-a-t|u|f service-address-r server-address [-g|i|m] [-w weight]

-t|u|f service-address: A pre-defined Cluster service

-R server-address: The Address of an RS, in the NAT model, the port mapping can be implemented using Ip:port;

[-g|i|m]: LVs type

-g:dr

-i:tun

-m:nat

[-W Weight]: Define server weights

Modification:-E

Delete:-d-t|u|f service-address-r server-address

For example:

# ipvsadm-a-T 202.100.1.8:80-r 1.1.1.19-m

# ipvsadm-a-T 202.100.1.8:80-r 1.1.1.20-m

View

-l|l: List

-N: Number format displays host address and port

--stats: Statistical data

--rate: Rate

--timeout: Shows the session timeout length for TCP, Tcpfin, and UDP

-C: Show current Ipvs connection status

Remove all cluster Services:-C: empty Ipvs rule

Save rule: # ipvsadm-s >/Specify Storage path

Load restore previous rule: # Ipvsadm-r </backup storage path

5. The NAT type instance background of the load Balancer cluster LVS :

Director Dispatch host two network cards, the external network card VIP is 202.100.1.8, the internal network card dip is 1.1.1.18

Two realserver host RIP are 1.1.1.19 and 1.1.1.20, the gateway must point to 1.1.1.18, and the HTTPD service is installed

650) this.width=650; "Src=" Http://s5.51cto.com/wyfs02/M00/84/59/wKiom1eN2HyyY6NuAADzNtE00RM306.jpg-wh_500x0-wm_3 -wmp_4-s_3758878914.jpg "title=" 1.jpg "alt=" Wkiom1en2hyyy6nuaadznte00rm306.jpg-wh_50 "/>

5.1.lvs_nat type instance Web load balancing, the scheduling method is RR

# ipvsadm-a-T 202.100.1.8:80-s RR

# ipvsadm-a-T 202.100.1.8:80-r 1.1.1.19-m

# ipvsadm-a-T 202.100.1.8:80-r 1.1.1.20-m

# IPVSADM-L-N

# ipvsadm-l-N--stats

5.2.lvs_nat type instance Web load balancer, modify the scheduling method to WRR, and modify the weight weight scale

# IPVSADM-E-T 202.100.1.8:80-s WRR

# IPVSADM-E-T 202.100.1.8:80-r 1.1.1.19-w 4-m

# IPVSADM-E-T 202.100.1.8:80-r 1.1.1.20-w 1-m

# IPVSADM-L-N

# ipvsadm-l-N--stats

6. load-balanced cluster LVS Dr Type instance background

650) this.width=650; "Src=" Http://s2.51cto.com/wyfs02/M02/84/59/wKiom1eN2InSCIFCAAEzmsVBTYs577.jpg-wh_500x0-wm_3 -wmp_4-s_224496654.jpg "title=" 2.jpg "alt=" Wkiom1en2inscifcaaezmsvbtys577.jpg-wh_50 "/>

And will continue to update the blog ...

This article is from the "Xavier Willow" blog, please be sure to keep this source http://willow.blog.51cto.com/6574604/1827757

NAT type of Load Balancer cluster LVS under Linux

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.