HeartBeat 3.x Application Raiders: Conceptual Composition and Working Principles

Table of Contents

Heartbeat 3.x application strategy: concept composition and Working principle1

First, the concept of Heartbeat Composition and working principle1

1. The concept of heartbeat1

2, HA cluster related terms1

(1) node (node). .. 1

(2) Resource (resource)1

(3) event 1

(4) Action (action)1

3. The composition of Heartbeat1< /span>

(1) The structure of Heartbeat1

( 2) The internal composition of Pacemaker and the relationship with each module 1

(3) The internal composition of Heartbeat3.x and the relationship between 1

< p>(4) The similarities and differences between the various versions of Heartbeat1

(5) General topology diagram of Heartbeat cluster1

< span style="color:#333333">


< span style="color:#333333">1. The conceptual composition and working principle of Heartbeat

< p>1, the concept of heartbeat

Heartbeatis Linux-HA A component in the project, also It is the most successful example of the current open source HA project. The full name of Linux-HA is High-Availability Linux. The goal of this open source project is to provide an enhanced Linux reliability and availability through the joint efforts of community developers ( availability) and serviceability (RAS) cluster solutions.

HeartbeatProvides all the basic functions required by HA software, such as heartbeat detection and resource takeover, monitoring system services in the cluster, transferring the owner of the shared IP address between nodes in the cluster, etc.

< p>Linux-HAOfficial website: http://www.linux-ha.org

http://hg.linux-ha.org p>

2, HA cluster-related terms

(1) node (node)

an independent host running the heartbeat process, called a node, the node is HA The core component of each node is running the operating system and heartbeat software services. In a heartbeat cluster, the nodes are divided into primary and secondary, which are called the primary node and the standby/backup node. Each node has a unique host name. And it has its own set of resources, and one or more application services are generally running on the master node. The standby node is generally in a monitoring state.

(2) resource (resource )

Resources are entities that a node can control, and when a node fails, these resources can be taken over by other nodes. In heartbeat, The entities that can be regarded as resources are:

disk partition, file system, IP address, application service, NFS file system

< p>

(3) event (event)

That is what may happen in the cluster, such as node system failure, network connectivity failure, network card failure, application failure, etc. These events will lead to the transfer of node resources, and HA testing is also based on these events.

(4) action (action )

HA’s response mode when an event occurs, the action is controlled by shell steps, for example, when a node fails, backup The node will shut down or start the service through the pre-set execution script. And then take over the resources of the failed node.

3, the composition of Heartbeat

< span style="color:#333333">(1) Structure of Heartbeat

Heartbeat1.xThe structure of version 2.0.x is very simple. Each module is concentrated in heartbeat. After version 3.0, the entire heartbeat project was split and divided into different projects for development. .

Heartbeat2.0.xThe modules that the previous version has:< /p>

heartbeat: Inter-node communication detection module

ha-logd: Cluster Event Log Service

 CCM (ConsensusCluster Membership): Cluster member consistency management module

 LRM (LocalResource Manager ): Local resource management module

 Stonith Daemon: Disconnect the problematic node from the cluster environment

< span style="color:#333333"> CRM (Clusterresource management): Cluster resource management module

 Cluster policy engine: Cluster strategy engine

 Cluster transition engine: Cluster transition engine

Heartbeat3.0The components after the split:

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

Cluster Glue: It is equivalent to an intermediate layer, which is used to associate heartbeat with pacemaker. It mainly contains 2 parts, namely LRM And STONITH.

ResourceAgent: A collection of scripts used to control the start and stop of services and monitor the status of services. These The script will be called by LRM to start, stop, monitor, etc. of various resources.

Pacemaker: also known as Cluster ResourceManager (CRM for short), used to The control center that manages the entire HA, the client configures, manages, and monitors the entire cluster through pacemaker.

Pacemaker A variety of user management interfaces are provided, as follows:

1) crm shell: character-based management;

2) A web konsole window using Ajax Web configuration mode;

3) hb_gui , the gui graphic configuration tool for heartbeat, which is also the default GUI configuration tool for 2.1.x;

4< /span>) DRBD-MC, a Java-based configuration management tool.

(2) Pacemaker’s internal composition and Relationship with each module

(3) Heartbeat3.x internal composition and relationship

< p> < /p>

(4) Similarities and differences between Heartbeat versions

< p>Compared with the 1.x style, the function changes after Heartbeat 2.1.x are as follows:

1)Keep all original features

For example, Network, heartbeat, can switch resources when the machine is down.

2)Automatically monitor resources

< span style="color:#333333">By default, every 2 minutes to check the running status of the resource. If the resource is found to be absent, it will try to start the resource. If it has not started successfully after 60s, the resource will switch to another node. The time can be modified.

3) Independent monitoring of each resource group can be achieved. p>

For example, apache runs on node1 and tomcat runs on node2. Heartbeat can simultaneously monitor the services of two hosts.

(5) General Heartbeat cluster Topology map

To be continued!

Leave a Comment

Your email address will not be published.