- scalable E-learing Solution with Moodle ,
- Single server e-learning IAAS Solution ,
- Gluster File System &
- LAMP server
With-out worrying about complex Setup ?
Let us read, and let us dance; these two amusements will never do any harm to the world. – Voltaire
Here is a one click solution for your Moodle Infrastructure.
During a rearchitecting phase for Moodle server, We found out that Moodle is not performing as expected when its been clustered.
Files are stored in $CFG->dataroot (moodledata) need to be accessed by all front end clustered servers & Database.
I tried integrating AWS EFS ( even though running on GlusterFS on backend), AWS S3fs (AWS S3 as a filesystem), Microsoft Azure File Storage was not giving the results as expected.
Unfortunately the results was devastating , the time to first byte always takes more than fourteen seconds https://moodle.org/mod/forum/discuss.php?d=418443 . I have seen cases of thirty mins in moodle community discussion (https://moodle.org/mod/forum/discuss.php?d=405061 )
There are complex solutions available on the worldWideWeb , but I wanted a simple ,effective and easy to setup Solution.
If you are using public cloud provider like AWS, Attaching a Multi attach EBS to servers will resolve the issue. $CFG->dataroot (moodledata) have to be in the Multi attach EBS.
The Limitation to this solution is Multi-Attach for io1 volumes is available in the following Regions only: us-east-1 , us-west-2 , eu-west-1 , and ap-northeast-2 . It can change in future but by the time I am writing this post this are the only available regions.
If you are considering data sovereignty or for any other compliance requirement you need a different approach.
GlusterFS (Gluster File System) is an open source Distributed File System that can scale out in building-block fashion to store multiple petabytes of data.
How can you integrate to your architecture ?
Introducing GFS-Moo , Gluster file system for Moodle.
This tutorial will help you to implement GlusterFS for your Moodle
I will be using AWS EC2 to implement the GFS-Moo.
In this blog I will be showing you how to install and configure Moodle with Gluster File System
You can run this script in any Debian based Linux instance.
Supports On-Prem & Public Cloud, here i am using AWS for demonstration purpose.
- Login to AWS Console and Create three EC2 (Ubuntu)
- Create Three Ec2 Instance with Security Group as shown below,(if you want to install just Moodle on a single server launch one EC2 with Moodle Security group)
- Note own all Public IP address of instance (if you have attached EIP then note down EIP)
For Security Groups Please refer from GitHub Repo
Let's Re-name Servers on Console
|Server||Rename to||Public IP|
|Server 1||GFS-Moo-01||ip1 (use your server1 public IP)|
|Server 2||GFS-Moo-02||ip2 (use your server2 public IP)|
|Server 3||GFS-Moo-03||ip3 (use your server3 public IP)|
- Use Putty to SSH into all three Servers, Configure putty
- If you want to use muti-SSH try mRemoteNG
- Also Note down the Public IP for all three servers, for the easy of understanding.
SSH into Servers orderly and run commands
Get root privilages to run command
sudo su -
- As we are installing GFS+Moodle+LAMP select option 5
- Enter the Public IP Address for GFS
Visit the IP http://yourip , you can see Moodle installation page
Step 4 GFS
- Now you will be asked to enter current host , lets select 3 , and press Enter.
- Follow Similar instruction as GFS-Moo-03
- Follow Similar instruction as GFS-Moo-03
- As we are running this script on Master node which is GFS-Moo-01, The script will try to probe the other nodes. This is why its important to run the script in other two nodes initially.
Get your DB Credentials. , if you don't know how to create RDS , Follow this Tutorial
Setup Moodle, go to link provided by script.
and setup your Moodle.
- Now do the Same with other two servers, make sure you enter same username and password, if you are doing this on an existing Moodle server update config.php file from the Moodle folder
Now run this command on all servers
sudo mount -t glusterfs gfs-moo-01:/gv0 /var/www/moodledata
- goto Moodledata folder (/var/www/moodledata)
- Now check on other serves on same folder. You will be able to see the replicated test.txt file.
Congratulations ... You have successfully configured glusterfs for Moodle