44Convert Storage to Active/Active
55--------------------------------
66
7+ .. NOTE ::
8+
9+ GFS2 is not available in a package repo for |CFS_DISTRO | |CFS_DISTRO_VER |.
10+ It can still be built from source, but doing so is scope of this document.
11+ The following instructions are still useful for older distributions or
12+ for installation from source. They have been updated where possible.
13+
714The primary requirement for an active/active cluster is that the data
815required for your services is available, simultaneously, on both
916machines. Pacemaker makes no requirement on how this is achieved; you
@@ -68,38 +75,80 @@ Activate our new configuration, and see how the cluster responds:
6875 * Started: [ pcmk-1 pcmk-2 ]
6976 [root@pcmk-1 ~]# pcs resource config
7077 Resource: ClusterIP (class=ocf provider=heartbeat type=IPaddr2)
71- Attributes: cidr_netmask=24 ip=192.168.122.120
72- Operations: monitor interval=30s (ClusterIP-monitor-interval-30s)
73- start interval=0s timeout=20s (ClusterIP-start-interval-0s)
74- stop interval=0s timeout=20s (ClusterIP-stop-interval-0s)
78+ Attributes: ClusterIP-instance_attributes
79+ cidr_netmask=24
80+ ip=192.168.122.120
81+ nic=enp1s0
82+ Operations:
83+ monitor: ClusterIP-monitor-interval-30s
84+ interval=30s
85+ start: ClusterIP-start-interval-0s
86+ interval=0s timeout=20s
87+ stop: ClusterIP-stop-interval-0s
88+ interval=0s timeout=20s
7589 Resource: WebSite (class=ocf provider=heartbeat type=apache)
76- Attributes: configfile=/etc/httpd/conf/httpd.conf statusurl=http://localhost/server-status
77- Operations: monitor interval=1min (WebSite-monitor-interval-1min)
78- start interval=0s timeout=40s (WebSite-start-interval-0s)
79- stop interval=0s timeout=60s (WebSite-stop-interval-0s)
90+ Attributes: WebSite-instance_attributes
91+ configfile=/etc/httpd/conf/httpd.conf
92+ statusurl=http://localhost/server-status
93+ Operations:
94+ monitor: WebSite-monitor-interval-1min
95+ interval=1min
96+ start: WebSite-start-interval-0s
97+ interval=0s timeout=40s
98+ stop: WebSite-stop-interval-0s
99+ interval=0s timeout=60s
100+ Resource: WebFS (class=ocf provider=heartbeat type=Filesystem)
101+ Attributes: WebFS-instance_attributes
102+ device=/dev/drbd1
103+ directory=/var/www/html
104+ fstype=xfs
105+ Operations:
106+ monitor: WebFS-monitor-interval-20s
107+ interval=20s timeout=40s
108+ start: WebFS-start-interval-0s
109+ interval=0s timeout=60s
110+ stop: WebFS-stop-interval-0s
111+ interval=0s timeout=60s
80112 Clone: WebData-clone
81- Meta Attrs: clone-max=2 clone-node-max=1 notify=true promotable=true promoted-max=1 promoted-node-max=1
113+ Meta Attributes: WebData-clone-meta_attributes
114+ clone-max=2
115+ clone-node-max=1
116+ notify=true
117+ promotable=true
118+ promoted-max=1
119+ promoted-node-max=1
82120 Resource: WebData (class=ocf provider=linbit type=drbd)
83- Attributes: drbd_resource=wwwdata
84- Operations: demote interval=0s timeout=90 (WebData-demote-interval-0s)
85- monitor interval=29s role=Promoted (WebData-monitor-interval-29s)
86- monitor interval=31s role=Unpromoted (WebData-monitor-interval-31s)
87- notify interval=0s timeout=90 (WebData-notify-interval-0s)
88- promote interval=0s timeout=90 (WebData-promote-interval-0s)
89- reload interval=0s timeout=30 (WebData-reload-interval-0s)
90- start interval=0s timeout=240 (WebData-start-interval-0s)
91- stop interval=0s timeout=100 (WebData-stop-interval-0s)
92- Resource: WebFS (class=ocf provider=heartbeat type=Filesystem)
93- Attributes: device=/dev/drbd1 directory=/var/www/html fstype=xfs
94- Operations: monitor interval=20s timeout=40s (WebFS-monitor-interval-20s)
95- start interval=0s timeout=60s (WebFS-start-interval-0s)
96- stop interval=0s timeout=60s (WebFS-stop-interval-0s)
121+ Attributes: WebData-instance_attributes
122+ drbd_resource=wwwdata
123+ Operations:
124+ demote: WebData-demote-interval-0s
125+ interval=0s timeout=90
126+ monitor: WebData-monitor-interval-29s
127+ interval=29s role=Promoted
128+ monitor: WebData-monitor-interval-31s
129+ interval=31s role=Unpromoted
130+ notify: WebData-notify-interval-0s
131+ interval=0s timeout=90
132+ promote: WebData-promote-interval-0s
133+ interval=0s timeout=90
134+ reload: WebData-reload-interval-0s
135+ interval=0s timeout=30
136+ start: WebData-start-interval-0s
137+ interval=0s timeout=240
138+ stop: WebData-stop-interval-0s
139+ interval=0s timeout=100
97140 Clone: dlm-clone
98- Meta Attrs: interleave=true ordered=true
141+ Meta Attributes: dlm-clone-meta_attributes
142+ interleave=true
143+ ordered=true
99144 Resource: dlm (class=ocf provider=pacemaker type=controld)
100- Operations: monitor interval=60s (dlm-monitor-interval-60s)
101- start interval=0s timeout=90s (dlm-start-interval-0s)
102- stop interval=0s timeout=100s (dlm-stop-interval-0s)
145+ Operations:
146+ monitor: dlm-monitor-interval-60s
147+ interval=60s
148+ start: dlm-start-interval-0s
149+ interval=0s timeout=90
150+ stop: dlm-stop-interval-0s
151+ interval=0s timeout=100
103152
104153 Create and Populate GFS2 Filesystem
105154###################################
@@ -202,11 +251,19 @@ With the ``WebFS`` resource stopped, let's update the configuration.
202251
203252 [root@pcmk-1 ~]# pcs resource config WebFS
204253 Resource: WebFS (class=ocf provider=heartbeat type=Filesystem)
205- Attributes: device=/dev/drbd1 directory=/var/www/html fstype=xfs
206- Meta Attrs: target-role=Stopped
207- Operations: monitor interval=20s timeout=40s (WebFS-monitor-interval-20s)
208- start interval=0s timeout=60s (WebFS-start-interval-0s)
209- stop interval=0s timeout=60s (WebFS-stop-interval-0s)
254+ Attributes: WebFS-instance_attributes
255+ device=/dev/drbd1
256+ directory=/var/www/html
257+ fstype=xfs
258+ Meta Attributes: WebFS-meta_attributes
259+ target-role=Stopped
260+ Operations:
261+ monitor: WebFS-monitor-interval-20s
262+ interval=20s timeout=40s
263+ start: WebFS-start-interval-0s
264+ interval=0s timeout=60s
265+ stop: WebFS-stop-interval-0s
266+ interval=0s timeout=60s
210267
211268 The fstype option needs to be updated to ``gfs2 `` instead of ``xfs ``.
212269
@@ -215,11 +272,19 @@ The fstype option needs to be updated to ``gfs2`` instead of ``xfs``.
215272 [root@pcmk-1 ~]# pcs resource update WebFS fstype=gfs2
216273 [root@pcmk-1 ~]# pcs resource config WebFS
217274 Resource: WebFS (class=ocf provider=heartbeat type=Filesystem)
218- Attributes: device=/dev/drbd1 directory=/var/www/html fstype=gfs2
219- Meta Attrs: target-role=Stopped
220- Operations: monitor interval=20s timeout=40s (WebFS-monitor-interval-20s)
221- start interval=0s timeout=60s (WebFS-start-interval-0s)
222- stop interval=0s timeout=60s (WebFS-stop-interval-0s)
275+ Attributes: WebFS-instance_attributes
276+ device=/dev/drbd1
277+ directory=/var/www/html
278+ fstype=gfs2
279+ Meta Attributes: WebFS-meta_attributes
280+ target-role=Stopped
281+ Operations:
282+ monitor: WebFS-monitor-interval-20s
283+ interval=20s timeout=40s
284+ start: WebFS-start-interval-0s
285+ interval=0s timeout=60s
286+ stop: WebFS-stop-interval-0s
287+ interval=0s timeout=60s
223288
224289 GFS2 requires that DLM be running, so we also need to set up new colocation
225290and ordering constraints for it:
@@ -231,20 +296,21 @@ and ordering constraints for it:
231296 Adding dlm-clone WebFS (kind: Mandatory) (Options: first-action=start then-action=start)
232297 [root@pcmk-1 ~]# pcs constraint
233298 Location Constraints:
234- Resource: WebSite
235- Enabled on:
236- Node: pcmk-2 (score:50)
237- Ordering Constraints:
238- start ClusterIP then start WebSite (kind:Mandatory)
239- promote WebData-clone then start WebFS (kind:Mandatory)
240- start WebFS then start WebSite (kind:Mandatory)
241- start dlm-clone then start WebFS (kind:Mandatory)
299+ resource 'WebSite' prefers node 'pcmk-2' with score 50
242300 Colocation Constraints:
243- WebSite with ClusterIP (score:INFINITY)
244- WebFS with WebData-clone (score:INFINITY) (rsc-role:Started) (with-rsc-role:Promoted)
245- WebSite with WebFS (score:INFINITY)
246- WebFS with dlm-clone (score:INFINITY)
247- Ticket Constraints:
301+ resource 'WebSite' with resource 'ClusterIP'
302+ score=INFINITY
303+ resource 'WebFS' with Promoted resource 'WebData-clone'
304+ score=INFINITY
305+ resource 'WebSite' with resource 'WebFS'
306+ score=INFINITY
307+ resource 'WebFS' with resource 'dlm-clone'
308+ score=INFINITY
309+ Order Constraints:
310+ start resource 'ClusterIP' then start resource 'WebSite'
311+ promote resource 'WebData-clone' then start resource 'WebFS'
312+ start resource 'WebFS' then start resource 'WebSite'
313+ start resource 'dlm-clone' then start resource 'WebFS'
248314
249315 We also need to update the ``no-quorum-policy `` property to ``freeze ``. By
250316default, the value of ``no-quorum-policy `` is set to ``stop `` indicating that
@@ -283,20 +349,21 @@ Notice how ``pcs`` automatically updates the relevant constraints again.
283349 [root@pcmk-1 ~]# pcs -f active_cfg resource clone WebFS
284350 [root@pcmk-1 ~]# pcs -f active_cfg constraint
285351 Location Constraints:
286- Resource: WebSite
287- Enabled on:
288- Node: pcmk-2 (score:50)
289- Ordering Constraints:
290- start ClusterIP then start WebSite (kind:Mandatory)
291- promote WebData-clone then start WebFS-clone (kind:Mandatory)
292- start WebFS-clone then start WebSite (kind:Mandatory)
293- start dlm-clone then start WebFS-clone (kind:Mandatory)
352+ resource 'WebSite' prefers node 'pcmk-2' with score 50
294353 Colocation Constraints:
295- WebSite with ClusterIP (score:INFINITY)
296- WebFS-clone with WebData-clone (score:INFINITY) (rsc-role:Started) (with-rsc-role:Promoted)
297- WebSite with WebFS-clone (score:INFINITY)
298- WebFS-clone with dlm-clone (score:INFINITY)
299- Ticket Constraints:
354+ resource 'WebSite' with resource 'ClusterIP'
355+ score=INFINITY
356+ resource 'WebFS-clone' with Promoted resource 'WebData-clone'
357+ score=INFINITY
358+ resource 'WebSite' with resource 'WebFS-clone'
359+ score=INFINITY
360+ resource 'WebFS-clone' with resource 'dlm-clone'
361+ score=INFINITY
362+ Order Constraints:
363+ start resource 'ClusterIP' then start resource 'WebSite'
364+ promote resource 'WebData-clone' then start resource 'WebFS-clone'
365+ start resource 'WebFS-clone' then start resource 'WebSite'
366+ start resource 'dlm-clone' then start resource 'WebFS-clone'
300367
301368 Tell the cluster that it is now allowed to promote both instances to be DRBD
302369Primary.
0 commit comments