Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

The installation and configuration method of heartbeat3.0.4

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)06/01 Report--

This article mainly introduces "the installation and configuration method of heartbeat3.0.4". In the daily operation, I believe that many people have doubts about the installation and configuration method of heartbeat3.0.4. The editor consulted all kinds of materials and sorted out simple and easy-to-use operation methods. I hope it will be helpful to answer the doubts of "installation and configuration method of heartbeat3.0.4". Next, please follow the editor to study!

(I) Environmental description

Operating system: centos 5.4x86x64

Node 1:

Hostname: aos

Ip:xxxxx.82

Node 2:

Hostname: weibo

Ip:xxxx.82

Note: both nodes should specify the corresponding relationship between the node hostname and ip in their respective hosts files. The hostname specified by the node parameter in ha.cf should be the same as that specified in the uname-a _ host file.

(2) composition of heartbeat3.0

The heartbeat3.0 version consists of three parts: Heartbeat, Cluster Glue, and Resource Agents

1. Hearbeat itself is the cluster messaging layer of the whole cluster, which is responsible for maintaining the information of each node in the cluster and their previous communication.

2. Cluster-glue is equivalent to an intermediate layer, which can connect heartbeat and crm (pacemaker). It mainly consists of two parts, LRM and STONITH.

3. Resource-agent, that is, ocf scripts for various resources, which will be called by LRM to enable various resources to start, stop, monitor, and so on.

(3) create users and groups

[root@aos ha.d] # groupadd haclient

[root@aos ha.d] # useradd hacluster-g haclient-s / sbin/nologin

(4) installation? Install Cluster-Glue

# tar jvxf Reusable-Cluster-Components-glue--glue-1.0.7.tar.bz2

# cd Reusable-Cluster-Components-glue--glue-1.0.7

#. / autogen.sh

#. / configure-prefix=/usr/local/ha_soft

# make

# make install

? Install resource-agent

# cd..

# tar zvxf ClusterLabs-resource-agents-agents-1.0.4-0-gc06b6f3.tar.gz

# cd ClusterLabs-resource-agents-c06b6f3/

#. / autogen.sh

#. / configure-prefix=/usr/local/ha_soft CFLAGS=-I/usr/local/ha_soft/include LDFLAGS=-L/usr/local/ha_soft/lib

# cp / usr/local/ha_soft/include/heartbeat/glue_config.h / usr/local/ha_soft/include/heartbeat/glue_config.h.bak

# vi / usr/local/ha_soft/include/heartbeat/glue_config.h (find the following settings to delete the corresponding lines)

HA_SYSCONFDIR

HA_HBCONF_DIR

HA_HBCONF_DIR

# make

# vim / etc/ld.so.conf.d/heartbeat.conf (enter the following line)

/ usr/local/ha_soft/lib

# ldconfig

# make install

? Install heartbeat

# cd..

# tar jvxf Heartbeat-3-0-STABLE-3.0.4.tar.bz2

# cd Heartbeat-3-0-STABLE-3.0.4

#. / bootstrap

#. / configure-prefix=/usr/local/ha_soft CFLAGS=-I/usr/local/ha_soft/include LDFLAGS=-L/usr/local/ha_soft/lib

# cp / srv/Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/hbaping.c / srv/Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/hbaping.c.bak

# vim / srv/Heartbeat-3-0-STABLE-3.0.4/lib/plugins/HBcomm/hbaping.c (install the source directory, delete line 326)

# make

# make install

(5) configuration (Node 1 and Node 2 are the same, except that check that ip is the other side)? Copy the configuration file from the source code compilation directory to the installation directory

Copy the configuration file in the attachment to / usr/local/ha_soft/etc/ha.d/

? Edit the ha.cf main configuration file

[root@aos ha.d] # cd / usr/local/ha_soft/etc/ha.d

[root@aos ha.d] # vim ha.cf

# debugfile / var/log/ha-debug

# logfile / var/log/ha-log

Logfacility local0

Keepalive 2

Deadtime 6

Warntime 4

Initdead 30

Udpport 694

Ucast eth2 192.168.1.200

Auto_failback off

Node aos

Node weibo

Compression bz2

Compression_threshold 2

Ping_group group1 xxxxx82 xxxx.80

Respawn root / usr/local/ha_soft/lib/heartbeat/ipfail

Apiauth ipfail gid=root uid=root

Debug 0

? Edit the authkeys verification information file

[root@aos ha.d] # cd / usr/local/ha_soft/etc/ha.d

[root@aos ha.d] # vim authkeys

Auth 1

1 crc

[root@aos ha.d] # chmod 600 authkeys

? Edit haresources resource control profile

[root@aos ha.d] # cd / usr/local/ha_soft/etc/ha.d

[root@aos ha.d] # vim haresources

Aos IPaddr::xxxxx.70/25/eht0/xxxxx.127

? Link file

[root@aos heartbeat] # vim / etc/ld.so.conf (add to the end of the file)

/ usr/local/ha_soft/lib/

[root@aos heartbeat] # ldconfig

# cp / usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs / usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs.bak

[root@aos heartbeat] # vim + 35 / usr/local/ha_soft/etc/ha.d/resource.d/hto-mapfuncs (comment 35 lines)

(VI) register and start the service

[root@aos ha.d] # chkconfig-- add heartbeat

[root@aos ha.d] # chkconfig levles 2345 heartbeat on

[root@aos ha.d] # / etc/init.d/heartbeat start

At this point, the study on the "method of installation and configuration of heartbeat3.0.4" is over. I hope to be able to solve your doubts. The collocation of theory and practice can better help you learn, go and try it! If you want to continue to learn more related knowledge, please continue to follow the website, the editor will continue to work hard to bring you more practical articles!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report