Building an Nextcloud HA Cluster Part 7 Configuring the Applications inside the Cluster



Please ensure that the Mysql/Mariadb Config file
is identical on both Nodes.

Please also make sure that Mysql/Mariadb is installed basicly on the Node where the Failoverfilesystem
/var/lib/mysql is mounted
if not check your Boxes.. where
is currently mounted…

if not…..
start mariadb on the Node where your Filesystems are mounted

systemctl start mysql.service

Then follow the Description in this Knowledge Base Article at Mariadb Documentation.

Now stop Mariadb again.

systemctl stop mysql.service

If you’re ensured that this problem is covered you’re able to configure Mysql/Mariabd

crm configure primitive res-mariadb mysql \
params test_table="" \
op start interval=0 timeout=120s \
op stop interval=0 timeout=120s \
op monitor interval=20s timeout=30s \
meta target-role=Started is-managed=true maintenance=false

To Create our first basic Dependencie we create a Group

crm configure group rg-mysql res-mysql res-mariadb

The Resource Group rg-mysql consists of the Filesystem Resource res-mysql which mounts on /var/lib/mysql
and the Resource res-mariadb.

If everything works well… the Resource res-mariadb should start on the Node where
/var/lib/mysql is mounted.

Creating the Apache Resource.

The Apache OCF Agent on SLES12/OpenSuSE Leap and CentOS7 is broken.
You have stickt to the Systemd Unit.

crm configure primitive res-apache systemd:apache2 \
meta maintenance=false is-managed=true target-role=Started

As before we create a basic Dependencie between the Application and the Filesystem to ensure Filesystem and Application are running on the same Node .

In Case we want that /srv/www/data and /srv/www/htdocs/nextcloud will start on the Same Box… we call the Resource Group rg-apache

crm configure group rg-apache res-srv-htdocs res-srv-nextcloud res-apache

After this we achieved the Goal that Apache is running together with the Filesystems needed by the Application.
We also achieved that Mysql/Mariadb is running with the necesary Filesystem.

But we don’t have a Dependencie between the Floating IP, Mysql and Apache.. in the Current Configuration both Resource Groups may run on the different nodes, or by accident on the same node.
Now we create Colocations
The Resource Groups

and the stonith_clone
should be colocoted with a Stickiness of 100.

crm configure colocation colocated_rgs 100: rg-apache:Started rg-mysql:Started rg-network:Started stonith_clone:Started

An additional Option thats very useful is the Startup Order… the Startup Order has to ensure that in first place the Filesystems come up in second the Network and the Application. If correctly set it will avoid Problems or failed Resources in case of possible Timeouts. This Startup Order is marked as mandatory.

crm configure order order-startup Mandatory: ( ms-drbd-mysql:start ms-drbd-nextcloud:start ms-drbd-www:start rg-network:start ) rg-mysql:start rg-apache:start symmetrical=false

Building an Nextcloud HA Cluster Part 7 Configuring the Applications inside the Cluster