The basic concept of the Internet server clusters Getting Started

2019-08-18

Keywords: Linux clusters, cluster server, cluster load balancing, high availability clustering


 

Internet services is a core component of the site. Such as shopping areas we have Taobao, Jingdong, fight a lot of other areas we have to travel by bit, about the first, pulling and other goods, communications, there are micro letter, QQ and so on. Behind these service sites rely on a PC with performance superior to provide various services. But with the Internet more widely covered by the crowd, penetration in people's lives more and more, every time we initiated service requests are massive, and the computing power of a single computer is extremely limited. In order to meet the rising demand, it creates a computing service model is called a "server clusters". This "server cluster" and can provide what is called "distributed computing" features that make computing needs with relevant business or organization can solve massive computational demand curve by increasing the number of computers. We can say that every server cluster is a large enterprise computing needs just to be.

 

What is a cluster of servers?

Server cluster is by multiple computers on a particular computing topics which consists of a synergistic characteristics and performance of the external division of labor as a whole computing model . Usually common purpose in terms of the cluster are in a single server computing while reducing the pressure to enhance the overall computing power.

 

For example, if you are a large library curator. Now doing inventory of the museum library. Book inventory is equivalent to a large number of computing needs, ask a person to do the equivalent of a large number of computing demands handed over to a server to do, that person's working pressure is certainly unusually large, it is likely he will not do half dry, even promise not to strike the middle, and so on that he did not know the complete inventory of these years to go. Therefore, in order to enhance the efficiency of inventory, you have to hire more than one person to have completed, to different people in different delegate count task, this model is the most reasonable of the book inventory mode. Server cluster is like this. In order to complete the task of inventorying books, gathered together to complete more than one person, everyone does different tasks, the curator of you, this is a whole group of people, because you just issued a book inventory task over a time count results are displayed in front of you.

 

In a cluster, each computer has a professional titles: node. For a cluster, its advantages and disadvantages are also obvious, in theory, its business processing capabilities can be no upper limit, can significantly improve business efficiency, but also to achieve business without interruption, but it also requires expensive to build and maintenance costs.

 

For a cluster to enhance the computing power is also very simple, can directly increase the node. For clusters, non-stop service node expansion is very easy to implement, more interestingly, a very loose cluster node performance requirements, we can completely as a new node is added into the better performance of the computer, which for clusters , can achieve non-stop service node will operate big shake.

 

Category cluster

There are three common cluster:

1, load balancing cluster

2, high availability clustering

3, high-performance scientific computing cluster

 

 

Load balancing cluster

Load balancing cluster is the most common, the most widely used type of server clusters. Its purpose is to share services overall pressure. The way it works is based on certain rules, requests from different sources distributed to different nodes for processing.

 

Load balancing cluster type of software and hardware can be divided into two kinds. Software-based load balancing there are three: 1, LVS; 2, NGINX; 3, HAPROXY. Hardware generally contact less type. Software and type in the number of LVS and NGINX with more. Currently LVS has been integrated into the Linux kernel to go.

 

Cluster load balancing architecture as generally shown in FIG.

It mainly consists of two structures:

1, the scheduler;

2, the service processing node;

 

Load balancing cluster mode of operation is only sent to the client's request scheduler node, the scheduler node will forward the request to the service processing to the service processing node after receiving the request in accordance with established rules. Although the scheduler node is not involved in the actual business processes, but its communication pressure is very large.

 

scheduler

The core part is that the scheduler scheduling algorithm. Scheduling algorithm can be divided into static and dynamic algorithm. Static algorithm is carried out in strict accordance with the distribution request requesting distribution regular pattern algorithm, dynamic algorithms will be distributed before the first of the current load of each node in the cluster research, integrated in the current node resource consumption and the algorithm itself later the decision to delegate the request to the client process which node. Clearly, the dynamic algorithm have better performance, but it also takes a little more resources.

 

Static scheduling algorithms are:

1, the polling;

2, weighted round robin;

3, source address hash;

4, destination address hashing;

 

Dynamic scheduling algorithm are:

1, at least the connection algorithm;

2, weighted least connections algorithm;

3, the shortest expected delay;

4, never line up;

 

Polling algorithm and least connections algorithm is the simplest and most mechanical of the algorithm. The former is a node in order to distribute the request, which is similar, the difference is which node is currently connected minimum number of give who distributed, that is, who's the minimum pressure who can be assigned to the task.

 

Upgraded version of a polling algorithm based on the least connections, type algorithm is weighted. The so-called weighting for each node is set to a "score", the node score is usually according to the performance assessment. Because there are different nodes may have different computing capabilities, in order to better calculate the amount in equal shares, so that a more rational use of cluster resources, strong computing capability should share more computing tasks, so-called "abler" Well .

 

The same request source address hash sucked all sources are distributed to the same node to handle, this algorithm is applicable to require authentication login credentials scene.

 

Requests for the same resource target address hash sucked all access to the server are sent sent to the same node. This algorithm is suitable for service processing node needs to fetch data from the scene elsewhere, in this case the application of this algorithm can improve the cache hit ratio, a pressure saving of the server.

 

 

High Availability Cluster

Purpose high-availability cluster is possible to ensure uninterrupted service . Usually a measure of the number 9 with a high-availability clustering capabilities when all is that time of the year the proportion of normal services. There are a few common criteria:

1、99%

2、99.9%

3、99.99%

4、99.999%

Most high availability clustering can do standard three 9's pretty good, costs go down on consumption is relatively high.

 

The purpose is to make high-availability cluster service is not interrupted, that server is not down, but in fact no one can guarantee that a computer can never be down, so to ensure uninterrupted service, it can only be after the service interruption restore it in the shortest possible time. Accordingly availability principle used is relatively simple, is to use hot standby mode duplex . Open business data exactly two nodes in the server needs to provide the service, even the best hardware configuration is exactly the same. One set to host that currently provide services and the other to the slave, the slave does not provide any services from the state machine only task is to monitor business data and host on the synchronization host. When the host service interruption, immediately took over the servicing rights, will be set to host their own, and then continue to provide services. And because the machine with a host of business data almost exactly the same, so this kind of behavior will not have to switch the machine customer service great an impact.

 

Although the principle of availability cluster technology is relatively simple, but it also has a great need for attention problems: split-brain phenomenon.

 

We know that from the host machine is the only way to monitor the current host of service interruption. However, the host of a service disruption not the kind of "black and white" mode. You slave monitor to the host service interruption, in fact, a host of services does not necessarily really interrupted. If for multiple hosts in the cluster appears from the machine lead to wrong judgment, it referred to the emergence of the phenomenon of brain row, the consequences of split brain phenomenon, but very serious. The solution to this problem mainly rely on prevention, rely on manual intervention when necessary. However, there are hardware-level split brain prevention device, such as a power switch. This thing is more rough, and when the host machine, it will cut off the power of the original host.

 

High-performance scientific computing cluster

This cluster is very far away from ordinary people. It is generally calculated by the strategic national resource control, the average person is a cluster of reach, but also untouchable.

 

 

About server cluster, there are very, very much knowledge, but the author is only for the purpose of expanding the horizons of learning, which is basically considered to have been swept blind, and also almost the same.

 


 

Guess you like

Origin www.cnblogs.com/chorm590/p/11361108.html