Replication or Clustering

Replication or Clustering

by Troy Garrett -
Number of replies: 3

Hi All,

Is it possible to replicate a Moodle server, or is that what clustering is?

We have a Moodle server running at our area data centre, however, our WAN traffic makes response times to our server less than ideal. I had thought that if it were possible to run a replica of our server locally, then using DNS redirects, the students would access our local machine while at school, and then it may sync data over the WAN to keep all things the same, so that when the students go home, they would then see the Data Centre machine.

Is such a setup possible, and if so, is there any documentation out there on how to do it? I'm the IT manager at a medium sized Australian high school (1200 kids) which means I'm a teacher who knows a bit about computers. If it's too difficult for the layman to set up, whom might I contact to come to my help?

Thanks in advance for any replies.

 

Troy

Average of ratings: -
In reply to Troy Garrett

Re: Replication or Clustering

by Simon Story -

Hello Troy,

Uh oh! You just asked for multi-master replication. My least favourite thing in the world. Well, that and nuclear war. Replication of the Moodle database and datafiles is something that is possible, but they are technologies seperate from Moodle itself. Making it even more difficult is that you'd want to run the replication over a (What I am guessing) slow WAN link. Generally multi-master replication is designed for systems with fast links between them.

Have you investigated a commercial WAN accelerator, or at a lower cost (Ie. free!) a caching http proxy server for the Moodle install located on-campus?

File downloads from Moodle are probably one of your bandwidth hogs too. Towards the bottom of this: http://docs.moodle.org/23/en/Performance_recommendations#Apache_performance there is a suggestion concerning the use if the mod_expires Module. The implication of that change is that web-browsers are instructed to locally cache some content for longer.

Other options could include faster internet, priortising traffic from your campus to where Moodle traffic over other traffic, a dedicated link and, running Moodle on-campus.

A moodle partner would be your best help with this: http://moodle.com/partners/

In reply to Troy Garrett

Re: Replication or Clustering

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hello Troy

You asked:
> Is it possible to replicate a Moodle server, or is that what clustering is?

In a http://en.wikipedia.org/wiki/Computer_cluster the components "are usually connected to each other through fast local area networks". Since your two servers are going to be in two different places (LANs) clustering is not what you are talking about.

The term which is used most often in this forum is mirroring, as in http://en.wikipedia.org/wiki/Mirror_%28computing%29. Mirrors used to be copies of FTP servers to avoid bottlenecks in their network connection, the SWITCH mirror http://mirror.switch.ch/ for example.

Now the bad news: The technology behind Moodle makes it unsuitable for mirroring. The short explanation is that Moodle needs three data storage areas, the database, moodledata and session files, which have to be synchronized very fast, almost instantaneous.

This has been discussed often in this forum. Use the 'advanced search facility' linked to the introduction to this forum. Here's an example: "How to Replicate MOODLE ??!!" http://moodle.org/mod/forum/discuss.php?d=173408. (Yes, some use the term replication, but that term is commonly used to mean database replication. See http://en.wikipedia.org/wiki/Replication_%28computing%29.

> We have a Moodle server running at our area data centre, however, our WAN traffic makes response times to our server less than ideal. I had thought that if it were possible to run a replica of our server locally, then using DNS redirects, the students would access our local machine while at school, and then it may sync data over the WAN to keep all things the same, so that when the students go home, they would then see the Data Centre machine.

The root cause is the slow Internet connection of the school, right? How come? Fast connections are not expensive these days. See also, "Need help regarding high availability" http://moodle.org/mod/forum/discuss.php?d=149182#p652633. (Sorry, it is not about http://en.wikipedia.org/wiki/High_availability.)
In reply to Troy Garrett

Re: Replication or Clustering

by Eric Long -

There is open source software called SymmetricDS that might be able to help. It performs asynchronous database replication over a slow or intermittent connnection, and it can be configured to detect and resolve conflicts with multi-master replication.  It works with all the same database platforms supported by Moodle.  There is also a commercial version with support called SymmetricDS Pro that includes a web interface to simplify setup and administration.


To mirror the moodledata files, you could use a tool like rsync, which is included on most Unix platforms.  SymmetricDS does not sync files yet, but people have successfully written plug-ins to sync files before.  I don't think you'd want to sync all the moodledata folders, since some are probably specific to the server, like cache, temp, and sessions, for example.