Forums / Install & configuration / 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

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

eZ debug

Timing: Jan 17 2025 23:52:02
Script start
Timing: Jan 17 2025 23:52:02
Module start 'content'
Timing: Jan 17 2025 23:52:03
Module end 'content'
Timing: Jan 17 2025 23:52:03
Script end

Main resources:

Total runtime1.2731 sec
Peak memory usage4,096.0000 KB
Database Queries215

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0069 589.5625180.7813
Module start 'content' 0.00691.1341 770.34381,045.3672
Module end 'content' 1.14100.1321 1,815.7109345.0156
Script end 1.2731  2,160.7266 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00460.3631220.0002
Check MTime0.00150.1142220.0001
Mysql Total
Database connection0.00100.081910.0010
Mysqli_queries1.065083.65512150.0050
Looping result0.00230.18282120.0000
Template Total1.242597.620.6212
Template load0.00260.200620.0013
Template processing1.239997.389620.6200
Template load and register function0.00010.007210.0001
states
state_id_array0.00080.064110.0008
state_identifier_array0.00130.102520.0007
Override
Cache load0.00210.1650490.0000
Sytem overhead
Fetch class attribute can translate value0.00160.125350.0003
Fetch class attribute name0.00130.1029110.0001
XML
Image XML parsing0.00280.218150.0006
class_abstraction
Instantiating content class attribute0.00000.0039160.0000
General
dbfile0.00280.2237530.0001
String conversion0.00000.000430.0000
Note: percentages do not add up to 100% because some accumulators overlap

CSS/JS files loaded with "ezjscPacker" during request:

CacheTypePacklevelSourceFiles
CSS0extension/community/design/community/stylesheets/ext/jquery.autocomplete.css
extension/community_design/design/suncana/stylesheets/scrollbars.css
extension/community_design/design/suncana/stylesheets/tabs.css
extension/community_design/design/suncana/stylesheets/roadmap.css
extension/community_design/design/suncana/stylesheets/content.css
extension/community_design/design/suncana/stylesheets/star-rating.css
extension/community_design/design/suncana/stylesheets/syntax_and_custom_tags.css
extension/community_design/design/suncana/stylesheets/buttons.css
extension/community_design/design/suncana/stylesheets/tweetbox.css
extension/community_design/design/suncana/stylesheets/jquery.fancybox-1.3.4.css
extension/bcsmoothgallery/design/standard/stylesheets/magnific-popup.css
extension/sevenx/design/simple/stylesheets/star_rating.css
extension/sevenx/design/simple/stylesheets/libs/fontawesome/css/all.min.css
extension/sevenx/design/simple/stylesheets/main.v02.css
extension/sevenx/design/simple/stylesheets/main.v02.res.css
JS0extension/ezjscore/design/standard/lib/yui/3.17.2/build/yui/yui-min.js
extension/ezjscore/design/standard/javascript/jquery-3.7.0.min.js
extension/community_design/design/suncana/javascript/jquery.ui.core.min.js
extension/community_design/design/suncana/javascript/jquery.ui.widget.min.js
extension/community_design/design/suncana/javascript/jquery.easing.1.3.js
extension/community_design/design/suncana/javascript/jquery.ui.tabs.js
extension/community_design/design/suncana/javascript/jquery.hoverIntent.min.js
extension/community_design/design/suncana/javascript/jquery.popmenu.js
extension/community_design/design/suncana/javascript/jScrollPane.js
extension/community_design/design/suncana/javascript/jquery.mousewheel.js
extension/community_design/design/suncana/javascript/jquery.cycle.all.js
extension/sevenx/design/simple/javascript/jquery.scrollTo.js
extension/community_design/design/suncana/javascript/jquery.cookie.js
extension/community_design/design/suncana/javascript/ezstarrating_jquery.js
extension/community_design/design/suncana/javascript/jquery.initboxes.js
extension/community_design/design/suncana/javascript/app.js
extension/community_design/design/suncana/javascript/twitterwidget.js
extension/community_design/design/suncana/javascript/community.js
extension/community_design/design/suncana/javascript/roadmap.js
extension/community_design/design/suncana/javascript/ez.js
extension/community_design/design/suncana/javascript/ezshareevents.js
extension/sevenx/design/simple/javascript/main.js

Templates used to render the page:

UsageRequested templateTemplateTemplate loadedEditOverride
1node/view/full.tplfull/forum_topic.tplextension/sevenx/design/simple/override/templates/full/forum_topic.tplEdit templateOverride template
7content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
7content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
7content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/pagelayout.tplEdit templateOverride template
 Number of times templates used: 24
 Number of unique templates used: 6

Time used to render debug report: 0.0002 secs