How To Run Mura On Load Balanced Servers
As of version 6+, Mura CMS uses the database to broadcast commands across load-balanced, or clustered servers. So, there's no need to change anything per se, because the instances "self register" themselves, assuming they're all sharing the same database. However, you may want to review some of our recommendations below.
Recommendations
Keeping Files In Sync Across Your Servers
You have a couple of options here, however our recommendation is to use a file-syncing utility like Microsoft DFSR, Gluster, RSync, or LSynchd:
- http://msdn.microsoft.com/en-us/library/bb540031(v=vs.85).aspx
- http://www.gluster.org
- http://rsync.samba.org
- https://github.com/axkibe/lsyncd
This allows the instance in the cluster to always be in sync. For example, if someone uploads a plugin, the files are automatically available to the other instances and all Mura needs to do is broadcast through the database to tell the other instances to reload.
Otherwise, another option is you could set the following variables in the file located under /config/settings.ini.cfm
fileDir=/complete/path/to/files assetDir=/complete/path/to/files assetPath=http://media.yourdomain.com createRequiredDirectories=false
If you do this, it is vitally important that you configure the webserver so that the domain http://media.yourdomain.com
root points to /complete/path/to/files/
The fileDir is where Mura stores files that have been uploaded as Primary Associated Image or "File" content types. The assetDir is where Mura stores any loose assets that have been uploaded via CKEditor's filemanager (CKFinder).
In addition, you can set the following variable in your /config/settings.ini.cfm:
puginDir=/path/to/plugins/
Then, add a symlink or virtual directory for "/plugins" in your site to point at /path/to/plugins/. If you do this, you will also want to explicitly add a mapping in the file located under /config/mappings.cfm.
<cfset this.mappings['/plugins'] = '/path/to/plugins/' />
Doing this may cause issues with some plugins, and those can usually be fixed quite easily.
Use Version Control System For Mura CMS Files
Using a file-syncing utility is great for monitoring assets being managed by content managers, however we highly recommend using a version control system (VCS), such as Git or Apache Subversion (SVN), to manage Mura CMS files. This way, you can designate a repository as the "Master" and push updates out to your load-balanced servers simulatenously from there. This process could be automated by leveraging some post commit hooks, etc. You could also create separate repositories for your themes, and plugins.
If you choose this method, we recommend disabling Mura's "Auto Update" feature by going to /config/settings.ini.cfm and update the following variable:
allowAutoUpdates=0
Then, reload your application. This way, nobody can accidentally update the Core or Site files on one server, while the other servers are running on an older version.
Caching
Finally, you may want to consider using the MuraCache plugin (https://github.com/blueriver/MuraCache). It allows Mura cache to be much more persistent and it does not require a clustered cache. It will work with the default Adobe ColdFusion and Railo caching.