Heartbeat (v1, v2, pacemaker) Cluster component Overview

Source: Internet
Author: User

Heartbeat (v1, v2, pacemaker) Cluster component Overview

1. What is Heartbeat?

Heartbeat is a Linux-based open-source high-availability cluster system. It mainly includes two high-availability cluster components: Heartbeat service and resource manager. The heartbeat monitoring service can be performed through the network link and serial port, and supports redundant links. They send messages to each other to indicate their current status, if the message sent by the other party is not received within the specified time, the other party is deemed invalid. In this case, the resource management module must be started to take over the resources or services running on the other host.

Ii. HeartBeat version

Heartbeat is a Linux-based open-source high-availability cluster system. It mainly includes two high-availability cluster components: Heartbeat service and Resource Management. Major version changes are divided into three phases.

1. Heartbeat v1.x

Heartbeat v1 has the concept of resource management, and v1's resources are included in heartbeat, which is called haresources. This file is a configuration file; this configuration file interface is called haresources;

Heartbeat1.x allows cluster nodes and resources to be configured through two files under the/etc/ha. d directory

Ha. cf: defines cluster nodes, failure detection and switching interval, cluster time log mechanism, and node Fence Method

Haresources: defines a cluster resource group. Each row defines a default node and a group of resources that can fail to be switched together. resources include IP addresses, file systems, services, and applications.

2. Heartbeat v2.x

When Heartbeat v2 is in version 2, heartbeat is greatly improved. You can run it as an independent process and receive user requests through it. It is called crm, during running, it needs to run a crmd process on each node. This process is usually monitored on a socket and the port is 5560. Therefore, the server is called crmd, the client is called crm (or crm shell) and is a command line interface. Through this command line interface, you can communicate with crm on the server. heartbeat also has its graphical interface tool, the heartbeat-GUI tool can be configured through this interface.

Heartbeat 2.0 introduces the module structure configuration method based on Heartbeat1.x, and the Cluster Resource Manager (Cluster Rescource Manager-CRM ).

The CRM model supports up to 16 nodes. This model is configured with Cluster Information Base-CIB based on XML.

Heartbeat 2.x the last official STABLE release 2.x version is 2.1.4.

The CIB file (/var/lib/heartbeat/crm/cib. xml) will be automatically copied between nodes. It defines the following objects and actions:

Cluster node

Cluster resources, including attributes, priorities, groups, and dependencies

Log, monitoring, arbitration and fence standards

Actions to be performed when the service fails or the set standards are met

3. Heartbeat v3.x

After V3. the entire heartbeat project is split into different sub-projects for separate development. However, the implementation principle of HA is basically the same as that of Heartbeat2.x, And the configuration is basically the same. After V3. it is split into heartbeat, pacemaker, and cluster-glue. The architecture is separated and can work with other components.

Heartbeat: the original message communication layer is independent of the heartbeat project, and the new heartbeat is only responsible for maintaining the information of each node in the cluster and their previous communication;

Cluster Glue: equivalent to an intermediate layer used to associate heartbeat with pacemaker. It consists of two parts: LRM and STONITH.

Resource Agent: a collection of scripts used to control service start/stop and monitor service status. These scripts are called by LRM to start, stop, and monitor various resources.

Pacemaker: Cluster Resource Manager (CRM) is used to manage the entire HA control center. The client uses pacemaker to configure, manage, and monitor the entire Cluster.

The first official release of Heartbeat 3 is 3.0.2. Previously, the CRM management was replaced by pacemaker, and the underlying message layer can still use heartbeat v3 or corosync. This document does not describe details. You can refer to clusterlabs.org separately.

Pacemaker is a resource manager that does not provide heartbeat information, because it seems to be a common misunderstanding and worth it. Pacemaker is a continuation of CRM (also known as Heartbeat V2 Resource Manager), initially for Heartbeat, but has become an independent project.

Core Components of Pacemaker:

Cluster Consensus Menbership Service, then, the results are transmitted to the upper layer, allowing the upper layer to decide what measures to take. ccm can also generate a topology Overview map of each node status, from the perspective of this node, ensure that the node can take corresponding actions under special circumstances.

Crmd component (Cluster Resource Manager, Cluster Resource Manager, or pacemaker): implements Resource allocation. Each action of Resource allocation must be implemented through crm, which is the core component, crm on each node maintains a cib to define the specific attributes of resources and which resources are defined on the same node.

Cib component (Cluster information Base, Cluster Infonation Base): a configuration file in XML format. It is a configuration file for Cluster resources in an XML format in the memory and is mainly stored in the file, at work time, It is resident in the memory and needs to be notified to other nodes. Only cib on the DC can be modified. cib on other nodes are copied to the DC. Methods for configuring cib files include command-line configuration and GUI configuration at the front-end.

Lrmd component (Local Resource Manager): used to obtain the status of a Local Resource and manage Local resources. If no heartbeat information is detected, to start local service processes.

Pengine component

PE (Policy Engine): A Policy Engine that defines a complete set of transfer methods for resource transfer. However, it is only a Policy maker and does not come in person to participate in the process of resource transfer, instead, let TE execute its own policy.

TE (Transition Engine): it is used to execute PE policies and only run PE and TE on the DC.

Stonithd component

STONITH (Shoot The Other Node in the Head, "headers") directly operates The power switch. If one Node fails, if the Other Node can detect it, A command is issued through the network to control the power switch of the faulty node. the faulty node is restarted by means of temporary power failure and power-on. This method requires hardware support.

In the STONITH application case (master-slave server), the master server does not have time to respond to heartbeat information at a certain end of time because of busy services. If the slave server suddenly grabs service resources, however, at this time, the master server has not been down, which will lead to resource preemption, so that users can access the master and slave servers. If only the read operations are okay, if there is a write operation, this will cause the file system to crash, so everything will be done. Therefore, when resources are preemptible, some isolation methods can be used to achieve this, that is, when the slave server grabs resources, directly sending the master server to STONITH is what we often call "headers ".

Resource scripts is the script under the Heartbeat control. These scripts can be used to add or remove an IP alias (IP alias) or a secondary IP address (secondary IP address), or to process data packets that are not able to start or stop services. Generally, Heartbeat reads the script file in the/etc/init. d/or/etc/ha. d/resource. d/directory. Heartbeat must always be clear about which node the "resource" belongs to or is provided. When writing a script to start or stop a resource, make sure that the script determines whether the service is provided by the current system.

For more details, please continue to read the highlights on the next page:

  • 1
  • 2
  • Next Page

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.