-
Notifications
You must be signed in to change notification settings - Fork 1
/
azure-gfs2
59 lines (43 loc) · 2.94 KB
/
azure-gfs2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
yum install -y pcs pacemaker fence-agents-azure-arm resource-agents nmap-ncat lvm2-lockd gfs2-utils dlm
passwd hacluster
systemctl start pcsd.service
systemctl enable pcsd.service
pcs cluster auth node0 node1 node2 -u hacluster
pcs cluster setup --name gfs2ha node0 node1 node2 --token 30000
pcs cluster start --all
pcs cluster enable --all
Identify the available instances that can be fenced.
fence_azure_arm -l [appid] -p [authkey] --resourceGroup=[name] --subscriptionId=[name] --tenantId=[name] -o list
fence_azure_arm -l <AD-Application-ID> -p <AD-Password> --resourceGroup <MyResourceGroup> --tenantId <Tenant-ID> --subscriptionId <Subscription-ID> -o list
Create a fence device.
pcs stonith create _clusterfence_ fence_azure_arm login=_AD-Application-ID_ passwd=_AD-passwd_ pcmk_host_map="_pcmk-host-map_ resourcegroup= _myresourcegroup_ tenantid=_tenantid_ subscriptionid=_subscriptionid_
--
pcs stonith create [name] fence_azure_arm login=[AD-Application-ID] passwd=[AD-Password] resourceGroup=[My ResourceGroup] tenantId=[Tenant-ID] subscriptionId=[Subscription-ID] pcmk_host_map="rhel-hostname-1:azure-name-1;rhel-hostname-2:azure-name-2;rhel-hostname-3:azure-name-3" pcmk_reboot_retries=4
--
pcs stonith create clusterfence fence_azure_arm login=e04a6a49-9f00-XXXX-XXXX-a8bdda4af447 passwd=a05AwCN-0IzAjVw-XXXXXXXEWI-oeVp0xg7QT resourceGroup=azrhelclirsgrp tenantId=77ecefb6-cff0-XXXX-XXXX-757a69cb9485 subscriptionId=XXXXXXXX-38b4-4527-XXXX-012d49dfc02c pcmk_host_map="node01:192.98.152.251;node02:192.102.162.225;node03:192.214.119.113" power_timeout=240 pcmk_reboot_timeout=480 pcmk_reboot_retries=4
///
Test the fencing agent for one of the other nodes.
pcs stonith fence _azurenodename_
Set the global Pacemaker parameter for fence
pcs property set no-quorum-policy=freeze
Set up a dlm resource.
pcs resource create dlm ocf:pacemaker:controld op monitor interval=30s on-fail=fence clone interleave=true ordered=true
Execute the following command in each node of the cluster to enable clustered locking.
/sbin/lvmconf --enable-cluster
Set up clvmd as a cluster resource.
pcs resource create clvmd ocf:heartbeat:clvm op monitor interval=30s on-fail=fence clone interleave=true ordered=true
Set up clvmd and dlm dependency and start up order.
pcs constraint order start dlm-clone then clvmd-clone
pcs constraint colocation add clvmd-clone with dlm-clone
Create the clustered logical volume.
pvcreate /dev/sdc
vgcreate -Ay -cy gfs2vg /dev/sdc
lvcreate -L5G -n gfs2lv gfs2vg
Format the logical volume with a GFS2 file system.
mkfs.gfs2 -j3 -p lock_dlm -t gfsha:gfs2 /dev/gfs2vg/gfs2lv
This cluster resource creation
pcs resource create clusterfs Filesystem device="/dev/gfs2vg/gfs2lv" directory="/nbfgfs" fstype="gfs2" options="noatime" op monitor interval=10s on-fail=fence clone interleave=true
pcs constraint order start clvmd-clone then clusterfs-clone
pcs constraint colocation add clusterfs-clone with clvmd-clone
mount |grep gfs
https://access.redhat.com/articles/3252491