This site has been archived and you can no longer log in or post new messages. For up-to-date community resources please visit

eZ Community » Forums » Install & configuration » MySQL Master Slave Setup with Unable...

MySQL Master Slave Setup with Unable to connect errow when slave is gone

MySQL Master Slave Setup with Unable to connect errow when slave is gone

Monday 24 January 2011 5:04:47 pm - 6 replies

Hi all,
when setting up a MySQL Master Slave Setup with the ini settings
I got an error, when the slave server is not reachable.
An unexpected error has occurred. Please contact the webmaster.
Unable to connect to the database server '' in /var/www/releases/ezp44/lib/ezdb/classes/ezmysqldb.php on line 151
I think, it would be better, when eZ Publish is still reachable, when only the master server is running.
Any opinions?
The start eZ setup:
2 nodes MySQL - one master, one slave
2 nodes eZ Publish with GlusterFS
2 nodes eZ Find

Greetings, ekke

Modified on Monday 24 January 2011 5:05:30 pm by Ekkehard Dörre

Tuesday 25 January 2011 7:02:44 am

I agree that the DB handler really should fallback to the master configuration if the slave is not available.

For the time being we utilise Triple-M ( for handling failover events. We assign floating IPs to mysql services and then failover the slave IP to another machine (master if needed).

Tuesday 25 January 2011 10:59:43 am

Hi Andrew,

mmm, we discussed this, more complexity, more possible errors is a nice thing for sites with many write requests, but for classical content sites with a lot of read requests and PHP sessions, a master with multiple slaves setup is still a good solution, but we should implement a better logic in eZ Publish.

I'll ask our customer, if they are willing to spend an eZ Enterprise Ticket on it, or we are looking deeper into mmm or the cluster solution.

Other opinions?

Greetings ekke

Tuesday 25 January 2011 11:02:19 am

Hi Ekkehard,

Check out the config options for mmm, you may not need to introduce multi-master complexity to achieve nice fail over. It adds another system to maintain, but perhaps not more complexity to your mysql setup.

Tuesday 25 January 2011 1:46:35 pm

While I agree that having smarter management inside of ez of master-slave setups would be nice (especially since this setup is supported with recent versions of postgres and oracle too, so that once it is coded in eZ it should be available to every user at no cost), generally speaking I prefer to push this kind of problems down to the architecture layer.

In the ideal world eZ should not even know about a master/slave setup. Oracle rac does it native of course, but it costs a huge amount of money, uses a lot of resources and is a pain to setup. Recent developments in the mysqlnd php driver indicate that we might get transparent load-balancing out of the box in the near future. Not sure about postgres, maybe there are commercial solutions (tungsten ?) doing that today.

The reason i say eZ should not care about this is because every complex architecture deployment has different needs in term of backups, availability, failover, polling, monitoring etc... A robust, complete and flexible solution takes a lot of time to develop, test and maintain. And in pur oss style, why reinvent the wheel inside eZ, if it already exists elsewhere?

Tuesday 25 January 2011 2:14:38 pm

Hi Andrew,

thanks for the hint, I'll give it to the system admin and

Gaetano, your are right with the perfect world approach, I forgot a blog post from Ulf Wendel: PHP: Transparent load balancing and sharding with mysqlnd this is a nice way.

Greetings ekke

Wednesday 27 April 2011 4:30:45 pm


Modified on Wednesday 27 April 2011 4:31:45 pm by Eduardo Fernandes


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from