This is an old revision of the document!
Преимущества перед CARP и VRRP
[nodeN:~] # pkg install heartbeat [nodeN:~] # ln -s /usr/local/bin/perl /usr/bin/perl [nodeN:~] # ls /usr/local/share/doc/heartbeat/ [nodeN:~] # cd /usr/local/etc/ha.d/
root@nodeN:~# apt install heartbeat root@nodeN:~# zless /usr/share/doc/heartbeat/ha.cf.gz root@nodeN:~# cd /etc/ha.d/
nodeN# cat ha.cf
#bcast em2 #bcast eth2 #ucast eth1 172.16.1.Y #ucast eth2 peernode deadtime 30 initdead 120 auto_failback off node node1.corpX.un node node2.corpX.un debugfile /var/log/ha-debug logfile /var/log/ha-log
nodeN# cat authkeys
auth 1 1 sha1 heartbeatpass
nodeN# chmod 600 authkeys nodeN# cat resource.d/ftpserv
#!/bin/sh # Don't forget disable autostart service # Uncomment starting services compatible with FreeBSD/Ubuntu case $1 in start) # service ftpd onestart # service proftpd start ;; stop) # service ftpd onestop # service proftpd stop ;; esac exit 0
nodeN# chmod +x resource.d/ftpserv nodeN# cat haresources
node1.corpX.un \ # IPaddr::192.168.X.10/32 \ # IPaddr2::192.168.X.10/32/eth0 \ ftpserv #node2.corpX.un \ # IPaddr::192.168.X.20/32 \ # IPaddr2::192.168.X.20/32/eth0 \ # smbserv
Комментарии, пробелы после \ и пустые строки не допустимы!
В freebsd использовать IPaddr, в Linux IPaddr2 (иначе может привязать адрес не к тому интерфейсу)
[nodeN:~] # service heartbeat rcvar [nodeN:~] # service heartbeat start
root@nodeN:~# /etc/init.d/heartbeat start
nodeN# tail -f /var/log/ha-debug | grep -v ER nodeN# tail -f /var/log/ha-log | grep -v authentication nodeN# cl_status nodestatus nodeN.corpX.un