Introduction to cluster technology under Linux

Source: Internet
Author: User

first, the definition of the cluster
A cluster is a set of services that work together to provide a more stable, efficient, and scalable service platform than a single service, and in the outside world, the cluster is a separate service entity, but in fact, within the cluster, there are two or more than two service entities coordinating and cooperating to complete a series of complex work.
Clusters generally have two or more than two servers are formed, each server is called a cluster node, the cluster nodes can communicate with each other, the way of communication there are two, one is based on the RS232 line of heartbeat monitoring, the other is a separate network card to run the heartbeat, thus, the cluster has node service status monitoring function , it must also have the extended capabilities of the service entity to flexibly Add and remove a service entity.
In a cluster, the same service can be provided by multiple service entities. Thus, when one node fails, the other node of the cluster can automatically take over the resources of the failed node, thus guaranteeing the service to run continuously and uninterrupted. So the cluster has the function of automatic fault transfer.
A clustered system must have a shared data store, because the services provided by the cluster are consistent, and when any one cluster node is running an application, the applied data is centrally stored in the node's shared space, while the operating system on each node runs only the service of the application and stores the application files.
To sum up, to build a cluster system requires at least two servers, but also need to have a serial cable, cluster software, shared storage devices (such as disk array) and so on.
Linux-based clusters stand out in a wide variety of applications with their high computing power, scalability, usability, and optimized cost-performance. Become a popular Linux application hotspot, master the knowledge of Linux cluster, can make high-performance application at low price. Cost savings for businesses and individuals. China's large-scale website Sina, NetEase and so on have used the Linux cluster system to build high-performance Web applications, the famous search engine Google used tens of thousands of Linux servers to form a super-large cluster, these examples illustrate the status and importance of the cluster in Linux applications.

Second, the characteristics and functions of the cluster

2.1 High Availability and scalability
1. High Availability
For some real-time application systems, must ensure that the service 24 hours uninterrupted operation, and because of software, hardware, network, human and other reasons, a single service operating environment is difficult to meet this requirement, it is a good choice to build a cluster system, one of the biggest advantages of building a cluster is that the cluster has high availability, In the event of a service failure, the cluster system can automatically switch the service from the failed node to another standby node, thus providing uninterrupted service and ensuring the continuous operation of the business.
2. Scalability
With the increase of business volume, the existing Cluster service entity can not meet the requirements, the cluster may be dynamically joined to one or more service nodes, so as to meet the needs of the application, enhance the overall performance of the cluster. This is the scalability of the cluster.

2.2 Load balancing and error recovery
1. Load Balancing
The biggest feature of the cluster system is that it can flexibly and effectively share the system load, and assign the client's access to the following service nodes through the load sharing policy defined by the cluster itself, for example, you can define the polling allocation policy, distribute the request evenly to each service node, and define the minimum load allocation policy. When a request comes in, the cluster system determines which service node is relatively idle and distributes the request to this node.
2. Error recovery
When a task is not completed on one node, and for some reason the execution fails, another service node should be able to proceed with this task, which is the error recovery function provided by the cluster, which ensures that each execution task can be completed effectively with the wrong redirection.

2.3 heartbeat detection and Drift ip
1. Heartbeat monitoring
  in order to achieve load balancing, provide high-availability services and perform error recovery, the cluster system provides heartbeat monitoring technology, heartbeat monitoring is achieved through the heartbeat line, Can make a heartbeat line of the device has RS 232 serial line, can also use a separate network card to run the heartbeat, can also be a shared disk array, etc., the number of heartbeat lines should be reduced by 1 of cluster nodes, it is important to note that if the heartbeat through the network card, each node needs two network card, wherein, A private network connected directly to the other machine's corresponding network card, used to monitor the other's heartbeat. Another piece connected to the public network to provide services, while the heartbeat network card and service network card IP address as far as possible in a network segment. The efficiency of heartbeat monitoring directly affects the length of failover time, and the cluster system keeps the internal communication between nodes through the heartbeat technology.
2. Drift IP address
  in the cluster system, in addition to each service node's own real IP address, there is a drift IP address, why is the drift IP, because this IP address is not fixed, For example, in the two-node dual-machine hot standby, the normal state, the drift IP is located on the primary node, when the primary node failure, the drift IP address automatically switch to the standby node, so in order to ensure the uninterrupted service, in the cluster system, the service IP provided by the external must be the drift IP address, Although the IP of the node itself can provide services externally, when this node fails, the service switches to the other node, but the service IP is still the IP address of the failed node, at which point the service is interrupted.

Iii. Classification of clusters

3.1 High-availability clusters

1. High-availability Concepts
The English full name of the high availability cluster is high availability Cluster, referred to as Ha Cluster, the highly available meaning is maximum usable, as can be seen from the name of the cluster, the function of such a cluster is to protect the user's application to provide durable, uninterrupted service.
When the application fails, or the system hardware, network failure, the application can automatically and quickly switch from one node to another node, so as to ensure the application of continuous, uninterrupted service, which is the function of high-availability cluster implementation,

2. Common Ha Cluster
We often say that two-machine hot-standby, dual-machine interoperability, multi-machine interoperability is a category of high-availability clusters, such clusters are generally composed of two or more than two nodes. Typical dual-machine hot-standby structure is shown in 1

650) this.width=650; "src=" Http://images.cnblogs.com/cnblogs_com/itech/linux/cluster1.png "height=" 185 "width=" 363 "Style=" margin:0px;padding:0px;border:0px; "/>

Figure 1 Dual-machine hot-standby structure

Dual-Machine hot standby is the simplest application mode, that is, often said Active/standby way, it uses two servers, one as the primary server (action), running the application external services, another as a standby machine (standby), installation and the same application as the master server, However, the service is not started and is in standby mode. Between the host and the standby through the heartbeat technology mutual monitoring, monitoring resources can be network, operating system, can also be a service, the user can according to their own needs, select the resources needed to monitor, when the standby monitoring to the host of a resource failure, according to the pre-set strategy, first IP switch over, Then the application service is also taken over, and then by the standby machine to provide services, due to the switching process time is very end, the user does not feel the program is not a problem, but also to switch, thus guaranteeing the application of durable, uninterrupted service.
Dual-machine Mutual preparation is on the basis of dual-machine hot standby, two independent applications on two machines at the same time running, mutual preparation, that is, two servers are both host and standby, when any one application failure, another server can in a short period of time the application of the fault machine to take over, thus ensuring the continuous, uninterrupted operation of the service. The advantage of dual-machine interoperability is to save equipment resources, two applications of the dual-machine hot standby requires at least four servers, and the dual-machine interoperability only requires two servers to complete the high-availability cluster function, but the dual-machine interoperability has its own shortcomings: After a node failover, the other node on the same run two application services, there are There may be situations where the load is too large.
Multi-machine Mutual preparation is a dual-machine hot standby technology upgrade, through a number of machines to form a cluster, can be set up a flexible takeover strategy between multiple machines, for example, a cluster environment has 8 servers, 3 running Web applications, 3 running mail applications, thus, can be the remaining one as a 3 Web server of the standby machine , another as a 3 mail server for the standby machine, through such a deployment, reasonable and fully utilize the server resources, but also ensure the high availability of the system.
It is important to note that the high-availability cluster does not guarantee the security of the application data, it only solves the external provision of uninterrupted service, the impact of software, hardware, network, human factors caused by the failure of the application to the bottom-level.
3. Highly Available cluster software
High-availability clusters are generally implemented with highly available software, and high-availability software commonly used under Linux includes: Open source Heartbea HA, Redhat-provided RHCS, business software rose, keepalived, etc. The configuration and use of Heartbea ha is described in detail in the following sections.

 

3.2 Load Balancer cluster
Unlike ha cluster, in a load-balanced cluster, all back-end nodes are active, and they all provide services externally, sharing the workload of the system.
node monitoring system is located in the front-end load dispatch machine, is responsible for monitoring the following service node, when a node fails, the node monitoring system will automatically remove the fault node from the cluster, when the node returns to normal, The node monitoring system is automatically added to the cluster, and all of this is completely transparent to the user.

650) this.width=650; "src=" Http://images.cnblogs.com/cnblogs_com/itech/linux/cluster2.png "height=" 280 "width=" 537 "Style=" margin:0px;padding:0px;border:0px; "/>

Figure 2 Basic architecture of load Balancing cluster

Load Balancing cluster can be implemented by software, or by hardware devices, the typical load balancing software under Linux is: Open source LVS cluster, Oracle RAC cluster, etc., hardware load balancer has F5 networks and so on. For the LVS cluster, we will explain it in detail in the following chapters.

3.3 Scientific Computing clusters
High Performance Computing (perfermance Computing) clusters, referred to as HPC clusters. Such clusters are dedicated to providing powerful computing power that a single computer cannot provide, including numerical computation and data processing, and tends to pursue comprehensive performance. HPC is similar to supercomputing, but it's different, and computing speed is the first goal of Supercomputing. The fastest speed, the biggest storage, the largest volume, the most expensive price represents the characteristics of supercomputing, with the increase of the demand for computing speed, supercomputing is also applied to various fields, the supercomputing pursuit of a single computational speed index into the pursuit of high-performance comprehensive indicators. That is, high performance computing.
HPC applications are widely used in a variety of applications: life science research, genetic testing, data mining applications, oil and gas exploration, and image presentation.


This article from the "Little Flash" blog, declined to reprint!

Introduction to cluster technology 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.