# Redhat
sudo yum install pacemaker corosync pcs -y
# Ubuntu
sudo apt-get install pacemaker corosync pcs -y
systemctl enable pcsd --now
passwd hacluster
sudo pcs host auth $SERVER_01 $SERVER_02 $SERVER_03 -u hacluster
# Username: hacluster
# Password:
# 192.168.7.11: Authorized
# 192.168.7.12: Authorized
# 192.168.7.13: Authorized
sudo pcs cluster setup $CLUSTER_NAME $SERVER_01 $SERVER_02 $SERVER_03
# No addresses specified for host '192.168.7.11', using '192.168.7.11'
# No addresses specified for host '192.168.7.12', using '192.168.7.12'
# No addresses specified for host '192.168.7.13', using '192.168.7.13'
# Destroying cluster on hosts: '192.168.7.11', '192.168.7.12', '192.168.7.13'...
# 192.168.7.11: Successfully destroyed cluster
# 192.168.7.12: Successfully destroyed cluster
# 192.168.7.13: Successfully destroyed cluster
# Requesting remove 'pcsd settings' from '192.168.7.11', '192.168.7.12', '192.168.7.13'
# 192.168.7.11: successful removal of the file 'pcsd settings'
# 192.168.7.12: successful removal of the file 'pcsd settings'
# 192.168.7.13: successful removal of the file 'pcsd settings'
# Sending 'corosync authkey', 'pacemaker authkey' to '192.168.7.11', '192.168.7.12', '192.168.7.13'
# 192.168.7.11: successful distribution of the file 'corosync authkey'
# 192.168.7.11: successful distribution of the file 'pacemaker authkey'
# 192.168.7.12: successful distribution of the file 'corosync authkey'
# 192.168.7.12: successful distribution of the file 'pacemaker authkey'
# 192.168.7.13: successful distribution of the file 'corosync authkey'
# 192.168.7.13: successful distribution of the file 'pacemaker authkey'
# Sending 'corosync.conf' to '192.168.7.11', '192.168.7.12', '192.168.7.13'
# 192.168.7.11: successful distribution of the file 'corosync.conf'
# 192.168.7.12: successful distribution of the file 'corosync.conf'
# 192.168.7.13: successful distribution of the file 'corosync.conf'
# Cluster has been successfully set up.
sudo pcs cluster start --all
# 192.168.7.11: Starting Cluster...
# 192.168.7.12: Starting Cluster...
# 192.168.7.13: Starting Cluster...
sudo pcs cluster enable --all
# 192.168.7.11: Cluster Enabled
# 192.168.7.12: Cluster Enabled
# 192.168.7.13: Cluster Enabled
sudo pcs resource create nfs-ganesha systemd:nfs-ganesha op monitor interval=30s
sudo pcs resource clone nfs-ganesha
pcs property set stonith-enabled=false
# pcs resource create $RESOURCE_NAME ocf:heartbeat:IPaddr2 ip=$VIRTUAL_IP cidr_netmask=24 op monitor interval=30s
pcs resource create virtual_ip ocf:heartbeat:IPaddr2 ip=192.168.7.10 cidr_netmask=24 op monitor interval=30s
pcs resource
# * Clone Set: nfs-ganesha-clone [nfs-ganesha]:
# * Started: [ 192.168.7.11 192.168.7.12 192.168.7.13 ]
#* virtual_ip (ocf::heartbeat:IPaddr2): Started 192.168.7.11
mount -t nfs 192.168.7.10:/volume01 /nfs
????
sudo pcs resource colocate add nfs-ganesha-clone virtual_ip
sudo pcs resource order add virtual_ip then nfs-ganesha-clone