Joan zuzenean edukira

Pacemaker

Pacemaker konfiguratzea

Pacemaker kluster- eta baliabide-kudeatzaile bat da.

CentOSen instalatzeko:

yum install corosync pacemaker pcs python-pycurl fence-agents-apc fence-agents-apc-snmp

Gaitu eta abiarazi zerbitzuak:

systemctl enable pcsd
systemctl enable corosync
systemctl enable pacemaker
systemctl start pcsd

Klusterrera batzeko pasahitz berri bat behar da. Erabiltzaile lehenetsia hacluster da:

passwd hacluster

Baimendu zerbitzariak, ezarri klusterraren izena eta abiarazi zerbitzu guztiak:

pcs cluster auth cluster1 cluster2
pcs cluster setup --name backup_cluster cluster1 cluster2
pcs cluster start --all

Ezarpen batzuk desgai daitezke konfigurazioa amaitu arte:

pcs property set stonith-enabled=false
pcs property set maintenance-mode=true

Existitu behar duen lehen baliabidea fencing gailu bat da:

pcs cluster cib stonith_cfg
pcs -f stonith_cfg stonith create stonith1 fence_apc_snmp ipaddr=192.0.2.111 pcmk_host_list="cluster1" pcmk_host_map="cluster1:6" pcmk_host_check=static-list power_wait=3 inet4_only=1 retry_on=10
pcs -f stonith_cfg stonith create stonith2 fence_apc_snmp ipaddr=192.0.2.112 pcmk_host_list="cluster2" pcmk_host_map="cluster2:6" pcmk_host_check=static-list power_wait=5 inet4_only=1 retry_on=10
pcs cluster cib-push stonith_cfg

Fitxategi-sistemaren baliabidea

pcs resource create backup_ext4 ocf:heartbeat:Filesystem device="/dev/drbd104" directory="/mnt/backup" fstype="ext4" "options=defaults,noatime" op monitor interval=10s
pcs resource create isard_ext4 ocf:heartbeat:Filesystem device="/dev/drbd102" directory="/mnt/isard" fstype="ext4" "options=defaults,noatime" op monitor interval=10s

IP mugikorrak

pcs resource create backup_ip ocf:heartbeat:IPaddr2 ip=192.0.2.110 cidr_netmask=32 nic=lan:0 op monitor interval=30
pcs resource create isard_ip ocf:heartbeat:IPaddr2 ip=198.51.100.200 cidr_netmask=32 nic=isard:0 op monitor interval=30

NFS v4 zerbitzaria

pcs cluster cib nfs_cfg
pcs -f nfs_cfg resource create nfs_daemon systemd:nfs-server op monitor interval=30s --group=nfs_server
pcs -f nfs_cfg resource create nfs_root ocf:heartbeat:exportfs clientspec=192.0.2.0/255.255.255.0 options=rw,crossmnt,async,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash directory=/mnt fsid=0 --group=nfs_server
pcs cluster cib-push nfs_cfg
pcs resource clone nfs_server master-max=3 master-node-max=1 clone-max=3 clone-node-max=1 on-fail=restart notify=true resource-stickiness=0

NFS v4 esportazioak

pcs cluster cib exports_cfg
pcs -f exports_cfg resource create backup_nfs ocf:heartbeat:exportfs clientspec=192.0.2.0/255.255.255.0 wait_for_leasetime_on_stop=true options=rw,mountpoint,async,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash directory=/mnt/backup fsid=5 op monitor interval=30s
pcs -f exports_cfg resource create isard_nfs ocf:heartbeat:exportfs clientspec=192.0.2.0/255.255.255.0 wait_for_leasetime_on_stop=true options=rw,mountpoint,async,wdelay,no_root_squash,no_subtree_check,sec=sys,rw,secure,no_root_squash,no_all_squash directory=/mnt/isard fsid=6 op monitor interval=30s
pcs cluster cib-push exports_cfg

Baliabide-taldeak

pcs resource group add backup backup_ext4 backup_nfs backup_ip
pcs resource group add isard isard_ext4 isard_nfs isard_ip

Aktibatu klusterra

pcs property set maintenance-mode=false
pcs property set stonith-enabled=true