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

Author Message

Ekkehard Dörre

Monday 24 January 2011 8:04:47 am

Hi all,
when setting up a MySQL Master Slave Setup with the ini settings
http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Configuration-files/site.ini/DatabaseSettings
with
UseSlaveServer=enabled
http://doc.ez.no/eZ-Publish/Technical-manual/4.x/Reference/Configuration-files/site.ini/DatabaseSettings/UseSlaveServer
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 'xxx.xxx.xxx.xxx:3306' 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

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Andrew Duck

Monday 24 January 2011 10:02:44 pm

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 (http://mysql-mmm.org/) for handling failover events. We assign floating IPs to mysql services and then failover the slave IP to another machine (master if needed).

Andrew Duck, Executive Director, Quiqcorp Limited
eZ Certified Developer and Trainer.
Member of the Community Project Board
http://quiqcorp.com | http://twitter.com/andrewduck

Ekkehard Dörre

Tuesday 25 January 2011 1: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 http://www.continuent.com cluster solution.

Other opinions?

Greetings ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Andrew Duck

Tuesday 25 January 2011 2: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.

Andrew Duck, Executive Director, Quiqcorp Limited
eZ Certified Developer and Trainer.
Member of the Community Project Board
http://quiqcorp.com | http://twitter.com/andrewduck

Gaetano Giunta

Tuesday 25 January 2011 4:46:35 am

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?

Principal Consultant International Business
Member of the Community Project Board

Ekkehard Dörre

Tuesday 25 January 2011 5:14:38 am

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 http://blog.ulf-wendel.de/?p=298 this is a nice way.

Greetings ekke

http://www.coolscreen.de - Over 40 years of certified eZ Publish know-how: http://www.cjw-network.com
CJW Newsletter: http://projects.ez.no/cjw_newsletter - http://cjw-network.com/en/ez-publ...w-newsletter-multi-channel-marketing

Eduardo Fernandes

Wednesday 27 April 2011 7:30:45 am

Checking

Best regards,

Eduardo Fernandes
Product Support Engineer
edf@ez.no | www.ez.no | eZ Systems

Powered by eZ Publish™ CMS Open Source Web Content Management. Copyright © 1999-2014 eZ Systems AS (except where otherwise noted). All rights reserved.