HomePage » LinuxHA » LinuxHeartbeat


HeartBeat 1.2.x installation and config


heartbeat commands
/usr/lib64/heartbeat/hb_standby
/usr/lib64/heartbeat/hb_takeover


create an authkeys file
auth 1
1 sha1 some-secret-here


Heartbeat config
ha.cf
udpport 3740
baud 9600
serial /dev/ttyS0
debugfile /var/log/ha-debug-log
debug 0
logfile /var/log/ha-log
ucast bond0 192.168.0.227
ucast eth3 10.0.0.227

auto_failback off
warntime 6
deadtime 13
initdead 20
keepalive 2
watchdog /dev/watchdog
respawn hacluster /usr/lib64/heartbeat/ipfail
# successful ping response from any hosts will be treated as positive reply
ping_group ipfail-ping 1.2.3.4 5.6.7.8

node    prod-ha-mysql01  prod-ha-mysql02

# stonith_host * plugin_name myhostname ilo_ip ilo_login ilo_pwd ilo_reset ilo_version action
stonith_host * external/riloe prod-ha-mysql02 10.0.0.225 Administrator xxxxxxx 1 2.0 reset


hapm.conf
socket=127.0.0.1:3306
time=60
graceful_time=55
heartbeat=/etc/init.d/heartbeat
heartbeatpid=/var/run/heartbeat.pid


expect script to stonith via ilo ssh - replaced by the riloe plugin above
#!/bin/bash

RECIPIENTS="sysadmin@domain.com"
ME="node1.domain.com"
YOU="node2.domain.com"

/bin/echo "$ME initiating forced restart of $YOU via ILO" | mail -s "$ME invokes STONITH" $RECIPIENTS
/opt/scripts/ilokill-node02.sh 1> /dev/null 2> /dev/null
exit 0


HA resources
haresources
node1.domain.com drbddisk::mirror0 \
Filesystem::/dev/drbd0::/disk1::ext3 \
nfs \
nfslock \
vsftpd \
Delay::3::0 \
IPaddr::10.1.1.30/24/eth2 \
IPaddr::222.222.222.222/26/eth0


Serial null modem
The above example already includes serial connections. Once the cable is connected and heartbeat started, you may tap into heartbeat's data by catting /dev/ttyS0 (or whatevery connections you're on)
		   cat </dev/ttyS0


If you need to test your serial connection, run the above on the recipient and then run the following on the sending machine:

		   echo hello >/dev/ttyS0 


It may be necessary to turn off flow control if you have a cable that doesn't meet the spec. Not 100% sure about this.
stty -F /dev/ttyS0 -crtscts


I simply add this to /etc/ha.d/harc:
ha_log "Turning off flow control..."
stty -F /dev/ttyS0 -crtscts


When serial connection is correctly setup, you may tap into its conversation with
cat < /dev/ttyS0
Comments [Hide comments/form]
Meredith as an end user I don't think I'd care w
-- 109.230.216.225 (2012-03-05 03:51:01)
Yied pun dah join.. Tapi kan, dari semalam Yied ta
-- hosted.by.xsserver.e (2012-03-06 21:23:13)
Valid XHTML 1.0 Transitional :: Valid CSS :: Powered by WikkaWiki