Forums / Setup & design / Clustering and mutihost access

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)