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:
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?
<?php // Moodle configuration file
$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