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
Last revision Both sides next revision
пакет_heartbeat [2019/03/22 14:56]
val [FreeBSD/Ubuntu/Debian]
пакет_heartbeat [2022/02/08 10:47]
val [Управление ресурсами]
Line 6: Line 6:
   * Возможность распределения сервисов по узлам кластера   * Возможность распределения сервисов по узлам кластера
  
-===== Установка и настройка =====+===== Установка и базовая ​настройка =====
  
 ==== Debian/​Ubuntu ==== ==== Debian/​Ubuntu ====
Line 12: Line 12:
 root@nodeN:​~#​ apt install heartbeat root@nodeN:​~#​ apt install heartbeat
  
-root@nodeN:​~systemctl enable heartbeat+debian11cat /​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
  
Line 37: Line 41:
 nodeN# cat ha.cf nodeN# cat ha.cf
 </​code><​code>​ </​code><​code>​
-#​bcast ​em2 +#​bcast ​eth0 
-bcast eth2+#bcast eth2
 #ucast eth1 172.16.1.Y #ucast eth1 172.16.1.Y
 #ucast eth2 slave #ucast eth2 slave
Line 55: Line 59:
 </​code><​code>​ </​code><​code>​
 nodeN# chmod 600 authkeys nodeN# chmod 600 authkeys
 +</​code>​
  
-nodeN# cat resource.d/​ftpserv +===== Управление ресурсами ===== 
-</​code>​<​code>​ +<​code>​ 
-#!/bin/sh +nodeNls /etc/init.d/
-# 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# ls /​etc/​ha.d/​resource.d/​ 
-</code><​code>​ + 
-nodeNchmod +x resource.d/ftpserv+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 haresources nodeN# cat 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
-#​node1.corpX.un \ 
-#    IPaddr::​192.168.X.10/​32 \ 
-#    IPaddr2::​192.168.X.10/​32/​eth0 \ 
-#    ftpserv 
 #​node2.corpX.un \ #​node2.corpX.un \
 #    IPaddr::​192.168.X.20/​32 \ #    IPaddr::​192.168.X.20/​32 \
 #    IPaddr2::​192.168.X.20/​32/​eth0 \ #    IPaddr2::​192.168.X.20/​32/​eth0 \
-#    ​smbserv+#    ​smbd
 </​code>​ </​code>​
 Комментарии,​ пробелы после \ и пустые строки не допустимы! Комментарии,​ пробелы после \ и пустые строки не допустимы!
Line 92: Line 83:
 В freebsd использовать IPaddr, в Linux IPaddr2 (иначе может привязать адрес не к тому интерфейсу) В freebsd использовать IPaddr, в Linux IPaddr2 (иначе может привязать адрес не к тому интерфейсу)
  
-===== Запуск =====+===== Запуск/​Остановка ​=====
  
-==== FreeBSD ​====+==== Debian/​Ubuntu ​====
 <​code>​ <​code>​
-[nodeN:~service ​heartbeat ​rcvar+root@nodeN:​~# ​systemctl enable ​heartbeat
  
-[nodeN:~service heartbeat ​start+root@nodeN:​~# ​systemctl ​start heartbeat 
 + 
 +root@nodeN:​~#​ systemctl disable heartbeat 
 + 
 +root@nodeN:​~#​ systemctl stop heartbeat
 </​code>​ </​code>​
  
-==== Ubuntu/​Debian ​====+==== FreeBSD ​====
 <​code>​ <​code>​
-root@nodeN:~# service heartbeat start+[nodeN:~] # service heartbeat rcvar 
 + 
 +[nodeN:​~] ​# service heartbeat start
 </​code>​ </​code>​
  
-===== Проверки =====+===== Отладка =====
 <​code>​ <​code>​
 nodeN# cat /​var/​log/​ha-debug | grep -v ERR | grep -v autotoken nodeN# cat /​var/​log/​ha-debug | grep -v ERR | grep -v autotoken
пакет_heartbeat.txt · Last modified: 2022/03/17 12:11 by val