2 Web Server to One Mysql

2 Web Server to One Mysql

by Shay Hanna -
Number of replies: 4

Hello,

I`m trying to setup two or more web servers (apache2 + Php5) connecting to the same Moodle Database on one MySQL Server.

Those web servers will be behind f5 load balancer hardware device.

Is it possible to achieve that several web servers will connect to the same Moodle database on one MySQL server???

If so, is there an installation guide for that topology?

I success connect one web server to Moodle database on remote MySQL server but its seems that I cannot connect another web server to the same database.

Any Ideas?

Thanks.

 

Average of ratings: -
In reply to Shay Hanna

Re: 2 Web Server to One Mysql

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

All the config.php files should be exactly the same. That's it. There's no more to it. You need to do the same for the 'moodledata' files area too. You can connect multiple clients to the same database - that's what databases are for!!

If you are having problems we'll need to know the details of what is going wrong.

In reply to Howard Miller

Re: 2 Web Server to One Mysql

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Shay

In addition you have to keep an eye on sessions. Either the load balancer supports sticky sessions or you delegate the session handling to the database.

Of course there is this 'moodledata' ($CFG->dataroot) to which both servers need to have access, you knew that I believe. If not, make use of the 'Advanced search' linked to the intro to this forum.

If you are new, get each server working alone, i.e. without a load balancer, and then try to couple them.

P.S. You shoule leave a note in the "Installation problems" forum https://moodle.org/mod/forum/discuss.php?d=216576 pointing to this discussion as the follow-up. Ideally that discussion should have been moved here. I know, the site moderators are reluctant to do that fearing that might upset the posters. May be this Alice quote will help: http://ebooks.adelaide.edu.au/c/carroll/lewis/alice/chapter12.html#chapter12.
smile
In reply to Visvanath Ratnaweera

Re: 2 Web Server to One Mysql

by Simon Story -

The current version of Moodle defaults to storing sessions in the database.

In reply to Shay Hanna

Re: 2 Web Server to One Mysql

by Simon Story -

Hello Shay,

Is there and error message? As Howard says, there is nothing special to do for the database. Perhaps you forgot to allow access to the database from the second webserver?

http://docs.moodle.org/20/en/Create_Moodle_site_database#MySQL_client

You need to make sure you are sharing the moodledata directory between both webservers however.