Building an Nextcloud HA Cluster Part 6 DRBD Resources and Filesystems

image_pdfimage_print

To configure the Cluster Resources we have to create Multistate Resources for DRBD.

At first we’ll take care about the Mysql DRBD Block Devices Multistate Resource for Mysql/Mariadb dont wonder yourself, if you’re cluster seem to act a little bit weird. 🙂

So we create the Cluster Primitive that the DRBD Resource mysql is able to come up.


crm configure primitive drbd-mysql ocf:linbit:drbd \
params drbd_resource=mysql drbdconf="/etc/drbd.d/mysql.res" \
op monitor interval=29s role=Master \
op monitor interval=31s role=Slave

Secondly we create the Multistate Resource

crm configure ms ms-drbd-mysql drbd-mysql \
meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true target-role=Master

It might be possible that the output in crm_mon looks comparable and shows a failed Resource.
But thats not really a configuration Issue.


Stack: corosync
Current DC: suseclusternode0 (version 1.1.15-5.1-e174ec8) - partition with quorum
Last updated: Wed Aug 23 12:40:12 2017
Last change: Wed Aug 23 12:38:59 2017 by root via cibadmin on suseclusternode0

2 nodes configured
2 resources configured

Online: [ suseclusternode0 suseclusternode1 ]

Master/Slave Set: ms-drbd-mysql [drbd-mysql]
drbd-mysql (ocf::linbit:drbd): FAILED suseclusternode0 (blocked)

Failed Actions:
* drbd-mysql_stop_0 on suseclusternode0 'not configured' (6): call=7, status=complete, exitreason='none',
last-rc-change='Wed Aug 23 12:38:59 2017', queued=0ms, exec=43ms


After the Configuration.. we clean this up ..

If this should be the Case, cleanup the Resource.
crm resource cleanup ms-drbd-mysql

The Output should be now as expected .

2 nodes configured
2 resources configured

Online: [ suseclusternode0 suseclusternode1 ]

Master/Slave Set: ms-drbd-mysql [drbd-mysql]
Masters: [ suseclusternode0 ]
Slaves: [ suseclusternode1 ]

To get further we have to set up the Nextcloud Data Device, where our Data will be stored.
As before wie create the DRBD Primitive

crm configure primitive drbd-nextcloud ocf:linbit:drbd \
params drbd_resource=nextcloud drbdconf="/etc/drbd.d/nextcloud.res" \
op monitor interval=29s role=Master \
op monitor interval=31s role=Slave

And again… the Multistate Resource


crm configure ms ms-drbd-nextcloud drbd-nextcloud \
meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true target-role=Master

The Webserver Directory Device.
At least we’re on the finishing line.


crm configure primitive drbd-www ocf:linbit:drbd \
params drbd_resource=www drbdconf="/etc/drbd.d/www.res" \
op monitor interval=29s role=Master \
op monitor interval=31s role=Slave


crm configure ms ms-drbd-www drbd-www \
meta master-max=1 master-node-max=1 clone-max=2 clone-node-max=1 notify=true target-role=Master

Bringing up the Filesystems:

The last Step would be mounting the File System with our Clusterframework.
Again, we create our Primitives. Three of them are needed

The Mysql Filesystem

crm configure primitive res-mysql Filesystem \
params device="/dev/drbd2" directory="/var/lib/mysql" fstype=xfs \
meta target-role=Started is-managed=true maintenance=false \
op start interval=0 timeout=60s \
op stop interval=0 timeout=60s \
op monitor interval=20s timeout=40s

The Webserver Htdocs Filesystem.

crm configure primitive res-srv-htdocs Filesystem \
params device="/dev/drbd5" directory="/srv/www/htdocs/nextcloud" fstype=ext4 \
meta target-role=Started is-managed=true maintenance=false \
op start interval=0 timeout=60s \
op stop interval=0 timeout=60s \
op monitor interval=20s timeout=40s

The Nextcloud Data Filesystem


crm configure primitive res-srv-nextcloud Filesystem \
params device="/dev/drbd3" directory="/srv/www/data" fstype=btrfs \
meta target-role=Started is-managed=true maintenance=false \
op start interval=0 timeout=60s \
op stop interval=0 timeout=60s \
op monitor interval=20s timeout=40s

If you have completed those Steps… you may be able to see your filesystems.
Not Necessarily grouped together on one Node. Cause the Cluster doesnt knows about wanted Dependencies or special Relationships.
This Topic will be covered at the point when we deal bringing up the Applications.

Building an Nextcloud HA Cluster Part 6 DRBD Resources and Filesystems