Load balancing and cluster description

1. What clusters are?

1 cluster (cluster) technology is a relatively new technology, cluster technology can be obtained relatively higher returns in terms of performance, reliability, flexibility in the case of paying a lower cost, it is the task scheduling cluster the core technology system.

After the cluster of 2, may utilize a combination of computers and a plurality of request processing mass ( load balancing ), thereby obtaining a high processing efficiency, do backup (HA) with a plurality of computers, such that a machine breaks down any overall system or normal operation.

2, load balancing cluster technology

① load balancing (Load Balance): load balancing clusters provide an effective solution to resolve capacity issues for business needs. Load balancing cluster so that the load can be evenly shared processing as possible in the computer cluster.

② load applications typically include network traffic load and processing load, each node can bear some processing load, and dynamic allocation of processing load between the nodes can be implemented, for load balancing.

3, load balancing cluster technology

Load balancing (Load Balance)

Load balancing technology types: load balancing based on layer 4 and layer 7 based on the Load Balancing

Load balancing implementation: a hardware device or software load balancing load balancing

Hardware load balancing products: F5 , deeply convinced, Radware

Load balancing software products: LVS (Linux Virtual Server), Haproxy, Nginx, Ats (the Apache Server traffic)

4, FIG achieve results

Here Insert Picture Description

5, load balancing classification

Device Object (load balancing based on the use of the software / hardware load balancing ), OSI network layer applications ( load balancing on the network level ), and the geographical structure of the application ( local / global load balancing ) and so classified. The following highlights are the type of load balancing according to the OSI network layer to the application of the classification.
Load balancing can be roughly divided into the following categories:

  • Floor load balancing (mac)

    Is generally a virtual mac address mode, the virtual MAC address of an external request, the actual allocation of the rear end of the MAC address in response to receiving the load balancing.

  • Three-tier load balancing (ip)

    Usually virtual IP address mode, external to the virtual address request ip, load balancing the rear end of the actual IP address assigned after receiving the response.

  • Four load balancing (TCP)

    Load balancing on the basis of the three, with ip + port receives the request, and then forwarded to the corresponding machine.

  • Seven load balancing (http)

    The virtual url or the IP, host name received request, then the processing server corresponding to the steering.

In practice, the more common is the four-load and load seven. There is also the focus of both said load.

6, four load balancing (load balancing based on IP + port)

The so-called four-layer load balancing, which is mainly through the destination address and port in the packet, plus the server load balancing device selection mode is set, the final decision to select the internal server.
layer4

  1. In the three-tier load balancing based on IP address by issuing three (VIP), then added four port numbers to determine what needs to be done traffic load balancing, traffic needs to be handled NAT processing, forwarded to the backend server , and record the TCP or UDP traffic which is handled by the server, this follow all traffic connections are likewise forwarded to the same server process.

  2. In the usual TCP as an example, load balancing device upon receiving a first request from a client SYN, i.e. choose the best server in the above manner, and the packet destination IP address to be modified (changed backend server IP), forwarded directly to the server. Establish a TCP connection, that is, three-way handshake is the client and the server directly established, load balancing equipment just to play a forward motion. In some deployment scenarios, in order to ensure that the server package can be returned back to the correct load balancing device may also be the original source of the packet address to be modified while packet forwarding.

  3. Traffic load balancer to be processed corresponding to perform NAT processing, forwarded to the backend server, and record the TCP or the traffic over UDP is handled by which servers, all traffic subsequent to this connection are likewise forwarded to the same server process.

  4. Achieve four load balancing software are:

  • F5: hardware load balancer, function well, but the cost is high.
  • lvs: heavyweight four load software
  • haproxy: analog four forwards, more flexible

7, seven load balancing (based on URL or virtual host IP load balancing)

The so-called seven load balancing, also known as "content exchange" that is truly meaningful, mainly through the application layer content message, plus the server load balancing device selection mode is set, the final decision to select the internal server.

layer7

  1. In the four-layer load balancing based on the (four is not absolutely impossible to have seven layers), then consider the characteristics of the application layer, such as a Web server with load balancing, in addition to 80-port IP traffic based on whether uncritical need to be addressed , also based on seven of the URL, browser type, language to decide whether to perform load balancing.
  2. If you want to load balancing device and then select a server based on true application layer content, only the first final of the proxy server and client to establish a connection (three-way handshake), you may receive a packet to the application layer content sent by the client, then according to another specific fields in the packet, together with the choice of server load balancing device settings embodiment, the internal server determines the final selection. Load balancing device in this case, is more similar to a proxy server . Load balancing and front-end and back-end server that the client will establish a TCP connection, respectively. So from this point of view technical principles, seven significantly higher load-balancing requirements of the load balancing device, the processing capability is also inevitably lower than the seven four-deployment mode.
  3. Corresponding to the load balancer in addition to supporting load balancing than four, as well as application layer information analysis, etc. The information URI HTTP protocol, seven achieve load balancing. Such a load balancer can understand the application protocol.
  4. Achieve seven load balancing software are:
    • haproxy: natural load balancing skills, the full support of seven agents, to maintain the session, marking, transfer path;
    • nginx: only function better on the http protocol and mail protocol, performance and haproxy almost;
    • apache: Function poor
    • Mysql proxy: function can still be.

8, the difference between seven and four load load

Here Insert Picture Description
Summary: The difference between four and seven load load the biggest difference is the efficiency and functionality from the above comparison seems. Four load architecture design is relatively simple, do not need to parse the specific message content, will be relatively high on the network throughput and processing power, load balancing and seven advantages are reflected in the multi-functional, powerful and flexible control. In specific business architecture design, using four or seven loads loads have to consider depending on the situation.

Published 48 original articles · won praise 18 · views 3643

Guess you like

Origin blog.csdn.net/wx912820/article/details/104928409