Moodle Cluster best practice

Moodle Cluster best practice

by Arkadius Kalkowski -
Number of replies: 1

Hello,

i just setup a moodle cluster and it is working, but i need some advice for best practice. The setup is as follows:

2 Kemp Loadmaster, which loadbalance to 3 mariadb galera cluster and 3 moodle webserver. The moodledata-directory is mounted as glusterfs with 3 bricks. There is also a redis server with 3 nodes and sentinel in work with the kemps for failover. 

1. Now there is an issue with mounting the glusterfs mounts for moodledata. The storage for glusterfs is mounted on another drive (as adviced). In fstab there are the following mounts

/dev/sdb1 /storage  ext4     defaults  0 0

localhost:/rep-volume /var/moodledata glusterfs defaults,_netdev 0 0

The bricks are at /storage/brick.

It seems that glusterfs is being mounted before the storage is mounted and it fails on reboot. I need to type mount -a. How can this be resolved so that it is mounted everytime on reboot?


2. The moodle docs describe:

"$CFG->dirroot

It is strongly recommended that $CFG->dirroot (which is automatically set via realpath(config.php)) contains the same path on all nodes. It does not need to point to the same shared directory though. The reason is that some some low level code may use the dirroot value for cache invalidation.

The simplest solution is to have the same directory structure on each cluster node and synchronise these during each upgrade.

The dirroot should be always read only for apache process because otherwise built in plugin installation and uninstallation would get the nodes out of sync."

What exactly does it mean? What do i need to do? For readonly do i need to do chmod -r 744? Then i can't install plugins? For installation i need to make it writable again and sync the directories and make it again readonly? Is there any better way?

3. Is there anything else i can do for best practice?

My config.php 


<?php  // Moodle configuration file


unset($CFG);

global $CFG;

$CFG = new stdClass();


$CFG->dbtype    = 'mariadb';

$CFG->dblibrary = 'native';

$CFG->dbhost    = 'xxx.xxx.xxx.xxx';

$CFG->dbname    = 'xx';

$CFG->dbuser    = 'xx';

$CFG->dbpass    = 'xx';

$CFG->prefix    = 'mdl_';

$CFG->dboptions = array (

  'dbpersist' => 0,

  'dbport' => '',

  'dbsocket' => '',

  'dbcollation' => 'utf8mb4_unicode_ci',

);


$CFG->tempdir   = '/var/moodletemp';

$CFG->wwwroot   = 'https://xxx';

$CFG->dataroot  = '/var/moodledata';

$CFG->admin     = 'admin';

$CFG->localcachedir = '/var/moodlecache';

$CFG->directorypermissions = 0777;


require_once(__DIR__ . '/lib/setup.php');



Thanks in advance

greeting Arek



Average of ratings: -
In reply to Arkadius Kalkowski

Re: Moodle Cluster best practice

by Gokhan Boranalp -
Gluster should be defined in /etc/fstab

See the example below:
```
gluster-0001:/moodledata /moodledata glusterfs defaults,_netdev,backupvolfile-server=gluster-0002 0 0
```