# Configure using a file jtel_cluster_config cd pcs cluster cib jtel_cluster_config # DRBD Primary Secondary pcs -f jtel_cluster_config resource create DRBDClusterMount ocf:linbit:drbd drbd_resource=jtelshared op monitor interval=60s pcs -f jtel_cluster_config resource promotable DRBDClusterMount promoted-max=1 promoted-node-max=1 clone-max=2 clone-node-max=1 notify=true # DRBD File System Mount pcs -f jtel_cluster_config resource create DRBDClusterFilesystem ocf:heartbeat:Filesystem device="/dev/drbd/by-res/jtelshared/0" directory="/srv/jtel/shared" fstype="xfs" # Colocation of File System Mount with Primary DRBD instance pcs -f jtel_cluster_config constraint colocation add DRBDClusterFilesystem with DRBDClusterMount-clone INFINITY with-rsc-role=Master # Promote first, then start filesystem pcs -f jtel_cluster_config constraint order promote DRBDClusterMount-clone then start DRBDClusterFilesystem # Resource for Samba pcs -f jtel_cluster_config resource create Samba systemd:smb op monitor interval=30s # Resource for virtual IP pcs -f jtel_cluster_config resource create ClusterIP ocf:heartbeat:IPaddr2 ip=${JT_VIP} cidr_netmask=32 op monitor interval=30s # Samba must be with active DRBD filesystem pcs -f jtel_cluster_config constraint colocation add Samba with DRBDClusterFilesystem INFINITY # Cluster IP must be with Samba pcs -f jtel_cluster_config constraint colocation add ClusterIP with Samba INFINITY # Start DRBD File system then start Samba pcs -f jtel_cluster_config constraint order DRBDClusterFilesystem then Samba # Start Samba then start Cluster IP pcs -f jtel_cluster_config constraint order Samba then ClusterIP |