Installing two Moodle servers and one database server

Installing two Moodle servers and one database server

James P-mit -
Antal besvarelser: 3

Hi,

I was wondering if there is a way to install two Moodle servers and run them off one database server so one server can be taken down and the other can stay up, or we run two in parallel. 

To install Moodle and the database we are using AWS Ubuntu Servers.

This is for a university assessment and our group is stuck.

Any help will be appreciated 

Thanks!

James


Gennemsnitsbedømmelse: -
I svar til James P

Re: Installing two Moodle servers and one database server

Visvanath Ratnaweera-mit -
Particularly helpful Moodlers-ip assinga Translators-ip assinga
Hi James

Look at these parameters in config.php:
$CFG->dbhost
$CFG->dbname
$CFG->dbuser
$CFG->dbpass

In the two config.php files, dbhost will be the same, the other three parameters different.

P.S. There is another more subtle variation, if it suits better. Have all the four parameter above identical but make the fifth parameter $CFG->prefix differ.
I svar til Visvanath Ratnaweera

Re: Installing two Moodle servers and one database server

Howard Miller-mit -
Core developers-ip assinga Documentation writers-ip assinga Particularly helpful Moodlers-ip assinga Peer reviewers-ip assinga Plugin developers-ip assinga

I don't think this is what he meant. Is this not just a "load balanced" front end that the OP wants?

Just point both Moodle instances to the same database server. The settings will be (must be!) identical. Note that they also have to share 'moodledata' (the folder pointed to by $CFG->dataroot in config.php)

They also have to have the same URL ($CFG->wwwroot). The quickest way to do that is a 'round robin' in DNS (Google it!). Although you can use a dedicated load balancer (AWS has one) if you are keen. 

I svar til Howard Miller

Re: Installing two Moodle servers and one database server

Visvanath Ratnaweera-mit -
Particularly helpful Moodlers-ip assinga Translators-ip assinga
James, if those "two Moodle servers" serve the same Moodle site, same $CFG->wwwroot, then what Howard described applies, with the additional point https://docs.moodle.org/en/Session_handling. Either the two servers share the session data through the common database (more resources) or can store locally (more efficient) if your load balance is "session aware".

This topic has been discussed many times in the Hardware and performance forum. But there is no Moodle-preferred method, simply because the architecture depends on the server environment you use.