This shows you the differences between two versions of the page.
| Both sides previous revision Previous revision Next revision | Previous revision | ||
|
пакет_pacemaker [2022/02/03 11:53] val [Запуск после монтирования файловых систем] |
пакет_pacemaker [2025/04/06 11:12] (current) val [Пакет Pacemaker] |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| ====== Пакет Pacemaker ====== | ====== Пакет Pacemaker ====== | ||
| + | |||
| + | * [[https://youtu.be/U-LOU6dkBqs|Отказоустойчивая конфигурация на примере Asterisk]] | ||
| * [[https://habrahabr.ru/post/107837/|Linux HA на основе Pacemaker]] | * [[https://habrahabr.ru/post/107837/|Linux HA на основе Pacemaker]] | ||
| + | * [[https://habr.com/ru/companies/postgrespro/articles/359230/|Кластер pacemaker/corosync без валидола Postgres Professional]] | ||
| * [[http://wiki.525.su/doku.php?id=pacemaker_theory|Pacemaker, теория]] | * [[http://wiki.525.su/doku.php?id=pacemaker_theory|Pacemaker, теория]] | ||
| * [[https://wiki.clusterlabs.org/wiki/Example_configurations|Example configurations]] | * [[https://wiki.clusterlabs.org/wiki/Example_configurations|Example configurations]] | ||
| Line 26: | Line 29: | ||
| node1# crm configure | node1# crm configure | ||
| </code><code> | </code><code> | ||
| - | property no-quorum-policy=ignore | + | property dc-deadtime=120 # Для уменьшения вероятности split-brain (НЕ помогает) |
| - | property dc-deadtime=120 | + | |
| + | property no-quorum-policy=ignore | ||
| primitive st-null stonith:null params hostlist="node1 node2" | primitive st-null stonith:null params hostlist="node1 node2" | ||
| clone fencing st-null | clone fencing st-null | ||
| + | |||
| + | op timeout=240s # Для долго стартующих ресурсов (перезапуск VM в KVM на резервном узле после падения основного) | ||
| show | show | ||
| Line 37: | Line 42: | ||
| </code><code> | </code><code> | ||
| nodeN# find /var/lib/pacemaker/cib/ | nodeN# find /var/lib/pacemaker/cib/ | ||
| + | |||
| + | nodeN# cat /var/lib/pacemaker/cib/cib.xml | ||
| </code> | </code> | ||
| Line 57: | Line 64: | ||
| node1# less /usr/lib/ocf/resource.d/heartbeat/IPaddr2 | node1# less /usr/lib/ocf/resource.d/heartbeat/IPaddr2 | ||
| + | |||
| + | node1# OCF_ROOT=/usr/lib/ocf OCF_RESKEY_ip=192.168.X.10 OCF_RESKEY_nic=eth0 OCF_RESKEY_cidr_netmask=24 /usr/lib/ocf/resource.d/heartbeat/IPaddr2 start | ||
| + | |||
| + | node1# OCF_ROOT=/usr/lib/ocf OCF_RESKEY_ip=192.168.X.10 OCF_RESKEY_nic=eth0 OCF_RESKEY_cidr_netmask=24 /usr/lib/ocf/resource.d/heartbeat/IPaddr2 stop | ||
| node1# crm configure | node1# crm configure | ||
| Line 62: | Line 73: | ||
| crm(live)configure# primitive pr_ip ocf:heartbeat:IPaddr2 params ip=192.168.X.10 cidr_netmask=32 nic=eth0 | crm(live)configure# primitive pr_ip ocf:heartbeat:IPaddr2 params ip=192.168.X.10 cidr_netmask=32 nic=eth0 | ||
| crm(live)configure# group gr_ftp_ip pr_ftp pr_ip | crm(live)configure# group gr_ftp_ip pr_ftp pr_ip | ||
| + | |||
| + | node1# export EDITOR=nano | ||
| + | |||
| + | crm(live)configure# edit pr_ip | ||
| crm(live)configure# edit gr_ftp_ip | crm(live)configure# edit gr_ftp_ip | ||
| Line 133: | Line 148: | ||
| * [[https://unix.stackexchange.com/questions/246935/set-systemd-service-to-execute-after-fstab-mount|Set systemd service to execute after fstab mount]] | * [[https://unix.stackexchange.com/questions/246935/set-systemd-service-to-execute-after-fstab-mount|Set systemd service to execute after fstab mount]] | ||
| + | * Проблема воспроизводилась при сбойных сценариях с ресурсами, использующими [[Сервис OCFS2]] | ||
| <code> | <code> | ||
| - | # cat /etc/fstab | ||
| - | </code><code> | ||
| - | ... | ||
| - | /dev/drbd0 /disk2 ocfs2 defaults,heartbeat=local 0 0 | ||
| - | #/dev/mapper/mpatha /disk3 ocfs2 defaults,heartbeat=local 0 0 | ||
| - | </code><code> | ||
| # systemctl list-units --type=mount | # systemctl list-units --type=mount | ||
| </code><code> | </code><code> | ||
| ... | ... | ||
| - | disk2.mount loaded active mounted /disk2 | + | disk3.mount loaded active mounted /disk3 |
| ... | ... | ||
| </code><code> | </code><code> | ||
| Line 150: | Line 160: | ||
| </code><code> | </code><code> | ||
| [Unit] | [Unit] | ||
| - | After=disk2.mount | + | After=disk3.mount |
| #After=disk2.mount disk3.mount | #After=disk2.mount disk3.mount | ||
| </code> | </code> | ||