User Tools

Site Tools


пакет_heartbeat

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revision Previous revision
Next revision
Previous revision
пакет_heartbeat [2021/10/22 11:15]
val [Debian/Ubuntu]
пакет_heartbeat [2026/10/14 13:38] (current)
val [Отладка]
Line 12: Line 12:
 root@nodeN:​~#​ apt install heartbeat root@nodeN:​~#​ apt install heartbeat
  
-root@nodeN:​~#​ systemctl enable 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 ​em2 +#​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 55: 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 69: Line 44:
 nodeN# ls /​etc/​ha.d/​resource.d/​ nodeN# ls /​etc/​ha.d/​resource.d/​
  
-nodeN# cat haresources+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
 </​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 81: Line 60:
 В freebsd использовать IPaddr, в Linux IPaddr2 (иначе может привязать адрес не к тому интерфейсу) В freebsd использовать IPaddr, в Linux IPaddr2 (иначе может привязать адрес не к тому интерфейсу)
  
-===== Запуск =====+===== Запуск/​Остановка ​=====
  
 ==== Debian/​Ubuntu ==== ==== Debian/​Ubuntu ====
 <​code>​ <​code>​
-root@nodeN:​~# ​service ​heartbeat ​start +root@nodeN:​~# ​systemctl enable ​heartbeat ​--now
-</​code>​ +
- +
-==== FreeBSD ==== +
-<​code>​ +
-[nodeN:~] # service heartbeat rcvar+
  
-[nodeN:~] # service ​heartbeat ​start+root@nodeN:​~# ​systemctl disable ​heartbeat ​--now
 </​code>​ </​code>​
  
 ===== Отладка ===== ===== Отладка =====
 <​code>​ <​code>​
-nodeN# ​cat /​var/​log/​ha-debug ​| grep -v ERR | grep -v autotoken+nodeN# ​tail -f /​var/​log/​ha-debug
  
 nodeN# service heartbeat status nodeN# service heartbeat status
пакет_heartbeat.1634890505.txt.gz · Last modified: 2021/10/22 11:15 by val