cluster_lvm_gfs2

apt-get install clvm

apt-get install gfs2-utils

apt-get install fence-agents

 

lvmconf –enable-cluster

reboot

dd if=/dev/zero of=stonith0 bs=1000000 count=100

losetup /dev/loop1 stonith0

pcs stonith create stonith0 fence_scsi devices=/dev/loop1 meta provides=unfencing

pcs property set no-quorum-policy=freeze

root@lap:~/Scrivania# pcs stonith show stonith0
Resource: stonith0 (class=stonith type=fence_scsi)
Attributes: devices=/dev/loop1
Meta Attrs: provides=unfencing
Operations: monitor interval=60s (stonith0-monitor-interval-60s)

pcs resource create dlm ocf:pacemaker:controld op monitor interval=30s on-fail=fence clone interleave=true ordered=true

pcs resource create clvmd ocf:heartbeat:clvm op monitor interval=30s on-fail=fence clone interleave=true ordered=true

root@lap:~/Scrivania# pcs constraint order start dlm-clone then clvmd-clone
Adding dlm-clone clvmd-clone (kind: Mandatory) (Options: first-action=start then-action=start)

pcs constraint colocation add clvmd-clone with dlm-clone

root@lap:~/Scrivania# pcs status resources
Resource Group: tomcatip
cluster11_IP (ocf::heartbeat:IPaddr2): Started lap.casa.it
tomcat8 (lsb:tomcat8): Started lap.casa.it
Clone Set: dlm-clone [dlm]
Stopped: [ lap.casa.it ]
Clone Set: clvmd-clone [clvmd]
Stopped: [ lap.casa.it ]

 

 

Links

https://www.server-world.info/en/note?os=CentOS_7&p=pacemaker&f=3