![]() |
The first thing that needs to be done after installing the hearbeat package is to set up the configuration file /etc/ha.d/ha.cf. It is well commented and fairly straight-forward to set up. Here are the options we used.
# File to write debug messages to
debugfile /var/log/ha-debug
#
#
# File to write other messages to
#
logfile /var/log/ha-log
#
#
# Facility to use for syslog()/logger
#
logfacility local0
# keepalive: how long between heartbeats?
#
keepalive 2
#
# deadtime: how long-to-declare-host-dead?
#
deadtime 30
#
# warntime: how long before issuing "late heartbeat"
warning?
# See the FAQ for how to use warntime to tune deadtime.
#
warntime 10
#
#
# Very first dead time (initdead)
#
initdead 120
#
#
# nice_failback: determines whether a resource will
# automatically fail back to its "primary" node,
or remain
# on whatever node is serving it until that node fails.
#
# The default is "off", which means that it WILL
fail
# back to the node which is declared as primary in haresources
#
# "on" means that resources only move to new nodes
when
# the nodes they are served on die. This is deemed as a
# "nice" behavior (unless you want to do active-active).
#
nice_failback on
#
# What UDP port to use for communication?
# [used by bcast and ucast]
#
udpport 694
#
# Set up a unicast / udp heartbeat medium
# ucast [dev] [peer-ip-addr]
#
# [dev] device to send/rcv heartbeats on
# [peer-ip-addr] IP address of peer to send packets to
#
ucast eth0 172.16.1.2
#
#
# Watchdog is the watchdog timer. If our own heart doesn't beat for
# a minute, then our machine will reboot.
#
watchdog /dev/watchdog
# Tell what machines are in the cluster
# node nodename ... - must match uname -n
node campeche
node chihuahua