Heartbeat 3 Cluster Knowledge (3) Heartbeat configuration

Source: Internet
Author: User
Tags resource time interval versions port number python script

The configuration of HA is divided into two parts, configured heartbeat and pacemaker, corresponds to the heartbeat version, and the configuration file has two versions, that is heartbeat1.x 1.x 2.1.x style version after style version and heartbeat2.1.x version

We can convert the 1.x style cluster resource profile into a 2.x style format, and use CRM to manage the entire cluster after the heartbeat2.1.x version. At the start of a cluster, all configuration operations are performed on the DC host and distributed to each node under the cluster by electing a node between nodes to become a DC (designated coordinator). The following are described in turn.

(1) Comparison of 1.x and 2.x profiles Ü/usr/local/ha/etc/ha.d/authkeys the file is exactly the same in two versions and must be set up and guaranteed to be the same as each node (nodes) content ü/usr/local/ha/etc/ HA.D/HA.CF This is the primary configuration file, determined by its V1 or V2 style format/usr/local/ha/etc/haresources This is the V1 resource profile ü/usr/local/ha/var/lib/heartbeat/ Crm/cib.xml This is the V2 resource configuration file, which can only be selected according to HA.CF settings. The V2 version uses CRM to manage the cluster, and Cib.xml files are written in several ways:

(a) manual authoring of XML files;

(b) Using the AdminTools tool, which is already included in the heartbeat package;

C Using GUI Graphics tool configuration, also included in the Heartbeat-gui package, this one will be introduced;

d Use the Python script to convert the format configuration file of the 1.x style to the 2.x style format.

These four methods are essentially the same, and it's easiest to convert to Python scripts. To do this, you can configure the format of the 1.x style first and then convert it through the Python script.

(2): Configure Heartbeat

First copy the template configuration file, and manually configure it if it is not installed

Cp/usr/local/ha/share/doc/authkeys/usr/local/ha/etc/ha.d

Cp/usr/local/ha/share/doc/ha.cf/usr/local/ha/etc/ha.d

Cp/usr/local/ha/share/doc/haresources/usr/local/ha/etc/ha.d

(3) Main configuration file (/ETC/HA.D/HA.CF)

logfile/var/log/ha-log# the log storage location of the named Heartbeat.
#crm Yes #是否开启Cluster Resource Manager (cluster resource management) feature.

Serial/dev/ttys0

Using serial heartbeat-If you do not use a serial heartbeat, you must use other media, such as Bcast (Ethernet) heartbeat. Replace/DEV/TTYS0 with appropriate device files.

Watchdog/dev/watchdog

This option is an optional configuration. The watchdog feature provides a system with minimal functionality that does not provide heartbeat and can be restarted after an abnormal clock condition. This function helps to prevent a machine from recovering heartbeat after it has been found dead. If this happens and the disk mount is migrated due to a failure (fail over), it is possible for two nodes to mount a disk at the same time. If you want to use this feature, in addition to this line, you will need to load the "Softdog" kernel module and create the appropriate device files. The method is to load the module with the command "Insmod Softdog". Then enter "grep misc/proc/devices" and remember the resulting number (which should be 10). Then type "Cat/proc/misc | grep watchdog "And remember the output number (should be 130). Based on the information obtained above, you can create a device file, "Mknod/dev/watchdog C 10 130".

Bcast eth1

Represents the use of broadcast heartbeat on the Eth1 interface (replace eth1 with eth0,eth2, or any interface you use).

#ucast eth0 192.168.1.2# using the network card eth0 UDP Tan Bolai organization Heartbeat, followed by the IP address should be dual-computer IP address.

#mcast eth0 225.0.0.1 694 1 0# Use network card eth0 UDP multicast to organize the heartbeat, generally in more than one standby node. Bcast, Ucast and Mcast respectively represent broadcast, unicast and multicast, which is the three ways to organize the heartbeat, either one can be selected.

KeepAlive 2

The time interval between setting heartbeat is 2 seconds.

Warntime 10

The time, in seconds, to wait before issuing the "late Heartbeat" warning in the log.

Deadtime 30

The node was declared dead after 30 seconds.

Initdead 120

Under certain configurations, it takes some time for the network to work properly after restarting. This individual "deadtime" option can handle this situation. Its value should be at least twice times that of the usual deadtime.

Baud 19200

Baud rate, the speed of serial communication.

Udpport 694

Use port 694 for bcast and ucast communication. This is the default and is officially registered in the IANA port number.

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.