Преимущества перед CARP и VRRP
root@nodeN:~# apt install heartbeat root@nodeN:~# zless /usr/share/doc/heartbeat/ha.cf.gz
nodeN# cat /etc/ha.d/ha.cf
#bcast eth0 #ucast eth0 192.168.X.3-N 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 /etc/ha.d/authkeys
auth 1 1 sha1 heartbeatpass
nodeN# chmod 600 /etc/ha.d/authkeys
nodeN# ls /etc/init.d/ nodeN# ls /etc/ha.d/resource.d/ node1# /etc/ha.d/resource.d/IPaddr2 192.168.X.10/32/eth0 start node1# /etc/ha.d/resource.d/IPaddr2 192.168.X.10/32/eth0 stop nodeN# cat /etc/ha.d/haresources
node1.corpX.un IPaddr2::192.168.X.10/32/eth0 proftpd #node2.corpX.un \ # IPaddr::192.168.X.20/32 \ # IPaddr2::192.168.X.20/32/eth0 \ # smbd
Комментарии, пробелы после \ и пустые строки не допустимы!
В freebsd использовать IPaddr, в Linux IPaddr2 (иначе может привязать адрес не к тому интерфейсу)
root@nodeN:~# systemctl enable heartbeat --now root@nodeN:~# systemctl disable heartbeat --now
nodeN# tail -f /var/log/ha-debug nodeN# service heartbeat status nodeN# cl_status nodestatus nodeN.corpX.un