Clustering and mutihost access

Author Message

Carlos Revillo

Friday 20 June 2008 2:29:17 am

Hi.
We're working in a clustering installation of ez. We have four siteaccess. lets call siteA, siteA_admin, siteB, and siteB_admin

siteA and siteA_admin should work with database A
siteB and siteB_admin should work with database B

we have doing all the stuff about clusterize things, but i'm a bit worried about the file index_cluster.php

The documentation shows this code

<?php
define( 'STORAGE_BACKEND',     'mysql'           );
define( 'STORAGE_HOST',        'localhost'       );
define( 'STORAGE_PORT',        3306              );
define( 'STORAGE_SOCKET',      ''                );
define( 'STORAGE_USER',        'user'            );
define( 'STORAGE_PASS',        'pass'            );
define( 'STORAGE_DB',          'name'            );
define( 'STORAGE_CHUNK_SIZE',  65535             );
 
include_once( 'index_image.php' );
?>

But how can we worki with two databes? We have added some condition usign $_SERVER['HOST_NAME']. Depending on the host name, we define storage_user, storage_pass and storage_db
All is working very well, but i think this is not a really elegant solution.

Do you know any other ways to have this working? We're thinkin in a way to set this things by siteaccess, but i don't really know,if we can use ezIni in this file...

Thank you.

Betsy Gamrat

Thursday 26 June 2008 4:32:16 pm

Carlos,

I used a single installation of eZ to run several sites, with separate databases. It worked well, although I tweaked the admin templates to ensure the admin users for each site access could only modify their site accesses.

You might want to try setting the site.ini database access parameters for the different site accesses to different databases, and making sure that the global site.ini doesn't override them.

Good luck.

Sébastien Morel

Thursday 26 June 2008 9:44:37 pm

Hi,

This is the cluster that is problematic, and especially how and where eZpublish will fetch images in BDD.
The index_cluster.php is the solution, but for different reasons, including performance, we must declare once again the login at the base. When we have two BDD, there is a problem.

Carlos, I think your method is ok. Myself, I would create a index_cluster2.php with the configuration of the other BDD, and I would change the RewriteRule according to the HOST(RewriteCond) in the Virtualhost.

+ +

[EDIT]
Or, with just one index_cluster.php (if the id BDD are the same) you could spend the name of the BDD argument directly from the Virtualhost and retrieve it in your script;)
[/EDIT]

--
eZ c'est plus fort que toi !
http://www.ez-france.org
http://blog.plopix.net
@Novactive (http://www.novactive.com)

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

eZ debug

Timing: Jan 18 2025 05:18:34
Script start
Timing: Jan 18 2025 05:18:34
Module start 'layout'
Timing: Jan 18 2025 05:18:34
Module start 'content'
Timing: Jan 18 2025 05:18:35
Module end 'content'
Timing: Jan 18 2025 05:18:35
Script end

Main resources:

Total runtime0.6634 sec
Peak memory usage4,096.0000 KB
Database Queries59

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0055 587.9141152.6250
Module start 'layout' 0.00550.0027 740.539139.4609
Module start 'content' 0.00820.6537 780.0000587.4531
Module end 'content' 0.66200.0014 1,367.453112.1641
Script end 0.6634  1,379.6172 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00310.4660160.0002
Check MTime0.00140.2070160.0001
Mysql Total
Database connection0.00100.150910.0010
Mysqli_queries0.612592.3243590.0104
Looping result0.00070.1013570.0000
Template Total0.634295.620.3171
Template load0.00190.284020.0009
Template processing0.632395.312420.3161
Template load and register function0.00030.040310.0003
states
state_id_array0.00090.131910.0009
state_identifier_array0.00080.121720.0004
Override
Cache load0.00160.2409300.0001
Sytem overhead
Fetch class attribute can translate value0.00060.096530.0002
Fetch class attribute name0.00140.218350.0003
XML
Image XML parsing0.00130.197530.0004
class_abstraction
Instantiating content class attribute0.00000.001850.0000
General
dbfile0.00100.1498220.0000
String conversion0.00000.001740.0000
Note: percentages do not add up to 100% because some accumulators overlap

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
3content/datatype/view/ezxmltext.tpl<No override>extension/community_design/design/suncana/templates/content/datatype/view/ezxmltext.tplEdit templateOverride template
5content/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
1content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
2content/datatype/view/ezimage.tpl<No override>extension/sevenx/design/simple/templates/content/datatype/view/ezimage.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 20
 Number of unique templates used: 7

Time used to render debug report: 0.0001 secs