{{parent page="LinuxHA"}} ===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== %%(text;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 %% %%(text;hapm.conf) socket=127.0.0.1:3306 time=60 graceful_time=55 heartbeat=/etc/init.d/heartbeat heartbeatpid=/var/run/heartbeat.pid %% %%(bash;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 == %%(text;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 %% 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 %%