Centos 6.5 configuring HA cluster

centoscentos6.5clusterheartbeathigh-availability

I need to configure HA cluster using 2 computers. But I've got a problem, when I'm trying to start a heartbeat service it starts but throws an error. Here's the error message:

Starting High-Availability services: ERROR: Cannot locate resource script IPaddr
/usr/share/heartbeat/ResourceManager: line 209: 192.168.1.199: command not found
Done.

The output in log file:

Oct  3 20:00:46 localhost heartbeat: [6213]: info: Pacemaker support: false
Oct  3 20:00:46 localhost heartbeat: [6213]: WARN: Logging daemon is disabled --enabling logging daemon is recommended
Oct  3 20:00:46 localhost heartbeat: [6213]: info: **************************
Oct  3 20:00:46 localhost heartbeat: [6213]: info: Configuration validated. Starting heartbeat 3.0.4
Oct  3 20:00:46 localhost heartbeat: [6214]: info: heartbeat: version 3.0.4
Oct  3 20:00:46 localhost heartbeat: [6214]: info: Heartbeat generation: 1411938913
Oct  3 20:00:46 localhost heartbeat: [6214]: info: glib: ucast: write socket priority set to IPTOS_LOWDELAY on eth0
Oct  3 20:00:46 localhost heartbeat: [6214]: info: glib: ucast: bound send socket to device: eth0
Oct  3 20:00:46 localhost heartbeat: [6214]: info: glib: ucast: set SO_REUSEPORT(w)
Oct  3 20:00:46 localhost heartbeat: [6214]: info: glib: ucast: bound receive socket to device: eth0
Oct  3 20:00:46 localhost heartbeat: [6214]: info: glib: ucast: set SO_REUSEPORT(w)
Oct  3 20:00:46 localhost heartbeat: [6214]: info: glib: ucast: started on port 694 interface eth0 to 192.168.1.145
Oct  3 20:00:46 localhost heartbeat: [6214]: info: G_main_add_TriggerHandler: Added signal manual handler
Oct  3 20:00:46 localhost heartbeat: [6214]: info: G_main_add_TriggerHandler: Added signal manual handler
Oct  3 20:00:46 localhost heartbeat: [6214]: info: G_main_add_SignalHandler: Added signal handler for signal 17
Oct  3 20:00:46 localhost heartbeat: [6214]: info: Local status now set to: 'up'
Oct  3 20:00:52 localhost heartbeat: [6214]: info: Link srv2:eth0 up.
Oct  3 20:00:52 localhost heartbeat: [6214]: info: Status update for node srv2: status up
Oct  3 20:00:52 localhost heartbeat: [6224]: ERROR: cannot exec /etc/ha.d//harc
Oct  3 20:00:53 localhost heartbeat: [6214]: info: Comm_now_up(): updating status to active
Oct  3 20:00:53 localhost heartbeat: [6214]: info: Local status now set to: 'active'
Oct  3 20:00:53 localhost heartbeat: [6214]: info: Status update for node srv2: status active
Oct  3 20:00:53 localhost heartbeat: [6228]: ERROR: cannot exec /etc/ha.d//harc
Oct  3 20:01:04 localhost heartbeat: [6214]: info: remote resource transition completed.
Oct  3 20:01:04 localhost heartbeat: [6214]: info: remote resource transition completed.
Oct  3 20:01:04 localhost heartbeat: [6214]: info: Initial resource acquisition complete (T_RESOURCES(us))
Oct  3 20:01:04 localhost ResourceManager(default)[6248]: ERROR: Cannot locate resource script IPaddr
Oct  3 20:01:04 localhost heartbeat: [6214]: WARN: 1 lost packet(s) for [srv2] [22:24]
Oct  3 20:01:04 localhost heartbeat: [6214]: info: No pkts missing from srv2!
Oct  3 20:01:04 localhost heartbeat: [6214]: info: remote resource transition completed.
Oct  3 20:01:04 localhost heartbeat: [6229]: info: Local Resource acquisition completed.
Oct  3 20:01:05 localhost heartbeat: [6273]: ERROR: cannot exec /etc/ha.d//harc

Here's configuration of heartbeat.
Comp1 and Comp2
/etc/ha.d/authkeys

auth 3
3 md5 37a747287238744a7bef7e9d52a53494

Comp1
/etc/ha.d/ha.cf

logfacility local0
keepalive 1
deadtime 10
ucast eth0 192.168.1.145
auto_failback off
node srv1
node srv2

Comp2
/etc/ha.d/ha.cf

logfacility local0
keepalive 1
deadtime 10
ucast eth0 192.168.1.146
auto_failback off
node srv1
node srv2

Comp1 and Comp2
/etc/ha.d/haresources

srv1 192.168.1.199 httpd

HA Cluster structure:

Comp1:

hostname – srv1

ip – 192.168.1.146

virtual ip – 192.168.1.199

Comp2:

hostname – srv2

ip – 192.168.1.145

What am I doing wrong? Please, help. Thank you!

Best Answer

Check whether the corresponding variables in /etc/ha.d/shellfuncs are set correctly:

: ${HA_DIR=/etc/ha.d}
: ${HA_RESOURCEDIR=$HA_DIR/resource.d}

and verifies in /etc/init.d/heartbeat:

. $HA_DIR/shellfuncs
Related Topic