nodeN# apt install pacemaker nodeN# crm_mon -1
node1# apt install crmsh node1# crm status node1# crm configure show node1# crm configure
property dc-deadtime=120 # Для уменьшения вероятности split-brain (НЕ помогает) property no-quorum-policy=ignore primitive st-null stonith:null params hostlist="node1 node2" clone fencing st-null op timeout=240s # Для долго стартующих ресурсов (перезапуск VM в KVM на резервном узле после падения основного) show commit quit
nodeN# find /var/lib/pacemaker/cib/ nodeN# cat /var/lib/pacemaker/cib/cib.xml
Resource Agents
node1# crm ra classes node1# crm ra list lsb node1# crm ra list systemd node1# crm ra list ocf heartbeat 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 crm(live)configure# primitive pr_ftp lsb:proftpd 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 node1# export EDITOR=nano crm(live)configure# edit pr_ip crm(live)configure# edit gr_ftp_ip crm(live)configure# show crm(live)configure# commit crm(live)configure# exit node1# crm status
node1# crm resource crm(live)resource# locate gr_ftp_ip crm(live)resource# exit или node1# crm resource locate gr_ftp_ip node1# crm configure show node1# crm resource move gr_ftp_ip node2 или node1# crm resource move pr_ftp node2 node1# crm configure show node1# crm configure delete cli-prefer-gr_ftp_ip или node1# crm configure delete cli-prefer-pr_ftp или node1# crm resource unmigrate gr_ftp_ip или node1# crm resource unmigrate pr_ftp
node1# crm configure show node1# crm resource stop gr_ftp_ip node1# crm configure delete gr_ftp_ip pr_ftp pr_ip
# crm resource cleanup pr_fs_r0 # stonith_admin -c -H node2.corpX.un pacemaker# crm_resource -C # tail -f /var/log/pacemaker/pacemaker.log
node1:~# cibadmin -E --force nodeN:~# init 6
# systemctl list-units --type=mount
... disk3.mount loaded active mounted /disk3 ...
# systemctl edit pacemaker.service
[Unit] After=disk3.mount #After=disk2.mount disk3.mount
primitive st-ssh stonith:external/ssh params hostlist="node1 node2" clone fencing st-ssh
# pacemaker 1.X () property stonith-enabled=false property default-resource-stickiness=100