Moodle Services Split:Part 2


Our goal was to split out the Apache & PHP services from the MySQL service  running on our Moodle server. The decision to do this was to address performance issue experience on the opening day of school after upgrading from Moodle 1.9 to 2.1 and switching server platforms from Linux to Apple.

So the question is where we able to do it and did it work?  Yes.

The following are the steps we took to split the services:

  1. Take the existing server offline.
  2. Clone server to new Apple Mini server (new)
    1. Used Carbon Copy Cloner
      1. approx. 180GB of data via Firewire 800 – 3hr 38minutes to transfer
  3. Configure the new server as Apache/PHP web server
    1. Change server serial number to avoid conflict
    2. Changed IP – Unix command – only needed if this machines IP is changing – we changed IP, but kept hostname
      1. sudo changeip [space] 123.456.789.000  [space] 987.654.321.000 [space] [space]
    3. Turn off MySQL service
    4. Change Moodle config.php file to point to MySQL server.
      1. $CFG->dbhost = ‘OLD HOST’; to $CFG->dbhost = ‘NEW HOST’;
    5. Double-check web server configuration
  4. Configure MySQL server (existing box)
    1. Turn on ‘Allow network connections’ in MySQL settings
    2. Configure access to moodle db my external host
      1. NOTE: This is a point we struggled with as we thought that the ‘Allow network connections’ would handle this step. Needed a MySQL admin tool (or command line) to add remote host and assign permissions – used MySQL Administrator
    3. Changed host name – we kept old IP but installed new hostname
      1. sudo changeip [space] 123.456.789.000 [space] 123.456.789.000 [space] [space]
  5. Make network changes (depends on infrastructure):
    1. Firewall ports
    2. Port forwards
    3. NAT changes

This process may not be the perfect process to use. We cloned servers as we had made numerous changes to configuration file during the original build that we didn’t want to worry about missing.  If there is something that seems odd or you believe we may have missed, please leave a comment as it will help us an other who might ready the post.

Special thanks to Adam Schechter from Precision Consulting and Ernest Koe (@ernestkoe) at The Proof Group (@proofgroup) for helping isolate and troubleshoot the issue in 4.B above.  THANKS GUYS!


About William Stites

Currently the Director of Technology for Montclair Kimberley Academy, "Blogger in Chief" for, husband and father to two crazy kids who make me smile everyday.
This entry was posted in Moodle, Technical and tagged , , , . Bookmark the permalink.