This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
пакет_heartbeat [2022/03/17 12:11] val [Отладка] |
пакет_heartbeat [2026/10/14 13:38] (current) val [Отладка] |
||
|---|---|---|---|
| Line 12: | Line 12: | ||
| root@nodeN:~# apt install heartbeat | root@nodeN:~# apt install heartbeat | ||
| - | debian11# cat /etc/rc.local | ||
| - | </code><code> | ||
| - | #!/bin/sh | ||
| - | |||
| - | mkdir /run/heartbeat/ | ||
| - | </code><code> | ||
| root@nodeN:~# zless /usr/share/doc/heartbeat/ha.cf.gz | root@nodeN:~# zless /usr/share/doc/heartbeat/ha.cf.gz | ||
| - | |||
| - | root@nodeN:~# cd /etc/ha.d/ | ||
| </code> | </code> | ||
| - | ==== FreeBSD ==== | ||
| - | <code> | + | ==== Debian/Ubuntu ==== |
| - | [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/ | + | |
| - | </code> | + | |
| - | + | ||
| - | ==== Debian/Ubuntu/FreeBSD ==== | + | |
| - | + | ||
| - | * При использовании 2-го интерфейса будут ошибки в логах из-за общей среды передачи. Для исправления ситуации можно использовать 0-ой интерфейс. | + | |
| <code> | <code> | ||
| - | nodeN# cat ha.cf | + | nodeN# cat /etc/ha.d/ha.cf |
| </code><code> | </code><code> | ||
| #bcast eth0 | #bcast eth0 | ||
| - | #bcast eth2 | + | #ucast eth0 192.168.X.3-N |
| - | #ucast eth1 172.16.1.Y | + | |
| - | #ucast eth2 slave | + | |
| deadtime 30 | deadtime 30 | ||
| initdead 120 | initdead 120 | ||
| Line 53: | Line 30: | ||
| logfile /var/log/ha-log | logfile /var/log/ha-log | ||
| </code><code> | </code><code> | ||
| - | nodeN# cat authkeys | + | nodeN# cat /etc/ha.d/authkeys |
| </code><code> | </code><code> | ||
| auth 1 | auth 1 | ||
| 1 sha1 heartbeatpass | 1 sha1 heartbeatpass | ||
| </code><code> | </code><code> | ||
| - | nodeN# chmod 600 authkeys | + | nodeN# chmod 600 /etc/ha.d/authkeys |
| </code> | </code> | ||
| Line 71: | Line 48: | ||
| node1# /etc/ha.d/resource.d/IPaddr2 192.168.X.10/32/eth0 stop | node1# /etc/ha.d/resource.d/IPaddr2 192.168.X.10/32/eth0 stop | ||
| - | nodeN# cat haresources | + | nodeN# cat /etc/ha.d/haresources |
| </code><code> | </code><code> | ||
| node1.corpX.un IPaddr2::192.168.X.10/32/eth0 proftpd | node1.corpX.un IPaddr2::192.168.X.10/32/eth0 proftpd | ||
| Line 87: | Line 64: | ||
| ==== Debian/Ubuntu ==== | ==== Debian/Ubuntu ==== | ||
| <code> | <code> | ||
| - | root@nodeN:~# systemctl enable heartbeat | + | root@nodeN:~# systemctl enable heartbeat --now |
| - | root@nodeN:~# systemctl start heartbeat | + | root@nodeN:~# systemctl disable heartbeat --now |
| - | + | ||
| - | root@nodeN:~# systemctl disable heartbeat | + | |
| - | + | ||
| - | root@nodeN:~# systemctl stop heartbeat | + | |
| - | </code> | + | |
| - | + | ||
| - | ==== FreeBSD ==== | + | |
| - | <code> | + | |
| - | [nodeN:~] # service heartbeat rcvar | + | |
| - | + | ||
| - | [nodeN:~] # service heartbeat start | + | |
| </code> | </code> | ||
| Line 106: | Line 72: | ||
| <code> | <code> | ||
| nodeN# tail -f /var/log/ha-debug | nodeN# tail -f /var/log/ha-debug | ||
| - | |||
| - | nodeN# cat /var/log/ha-debug | grep -v ERR | grep -v autotoken | ||
| nodeN# service heartbeat status | nodeN# service heartbeat status | ||