Cluster mode on eZ 4.0.3 [SOLVED]

Author Message

Jean-Luc Nguyen

Thursday 19 March 2009 4:54:44 am

Hello,

I am trying to pass my eZ 4.0.3 to cluster mode by following this doc: http://ez.no/doc/ez_publish/technical_manual/4_0/features/clustering

When adding image on backend, it is correctly added on ezdbfile* mysql tables, but on the backend & frontend, it is still going to /var/.../images/... directory, and the image is missing, which is logic.

I added on my vhost:

RewriteEngine On
    
RewriteRule content/treemenu/? /index_treemenu.php [L]
Rewriterule ^/var/storage/.* - [L]
Rewriterule ^/var/[^/]+/storage/.* - [L]
RewriteRule ^/var/cache/texttoimage/.* - [L]
RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
Rewriterule ^/design/[^/]+/(stylesheets|images|javascript|swf)/.* - [L]
Rewriterule ^/share/icons/.* - [L]
Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|swf|javascripts?)/.* - [L]
Rewriterule ^/packages/styles/.+/(stylesheets|images|swf|javascript)/[^/]+/.* - [L]
RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
RewriteRule ^/favicon\.ico - [L]
RewriteRule ^/robots\.txt - [L]
RewriteRule ^/info\.php - [L]

RewriteRule ^/var/[^/]+/cache/public/(stylesheets|javascript)/.* - [L]

# Uncomment the following lines when using popup style debug.
# RewriteRule ^/var/cache/debug\.html.* - [L]
# RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L]

# mode cluster
Rewriterule ^/var/([^/]+/)?storage/images-versioned/.*  /index_cluster.php  [L]
Rewriterule ^/var/([^/]+/)?storage/images/.*            /index_cluster.php  [L]

RewriteRule .* /index.php

did I miss something? How can I know that I am on cluster mode?

Thanks a lot!

http://www.acidre.com

Jérôme Renard

Thursday 19 March 2009 6:14:46 am

index_cluster.php no longer exists.

Can you try to create it with the following contents :

<?php
define( 'STORAGE_BACKEND',     'mysql'           );
define( 'STORAGE_HOST',        'db'              );
define( 'STORAGE_PORT',        3306              );
define( 'STORAGE_SOCKET',      '/tmp/mysql.sock' );
define( 'STORAGE_USER',        'user'            );
define( 'STORAGE_PASS',        'pass'          );
define( 'STORAGE_DB',          'cluster'         );
define( 'STORAGE_CHUNK_SIZE',  65535             );

include_once( 'index_image.php' );
?>

http://pubsvn.ez.no/nextgen/versions/4.0.3/index_image.php

Jean-Luc Nguyen

Thursday 19 March 2009 6:22:16 am

Yes, I have already created it with:

<?php
define( 'STORAGE_BACKEND',		'mysql'			);
define( 'STORAGE_HOST',			'localhost'		);
define( 'STORAGE_PORT',			''				);
define( 'STORAGE_SOCKET',		''              );
define( 'STORAGE_USER',			'my_user'   );
define( 'STORAGE_PASS',			'my_pass'     );
define( 'STORAGE_DB',			'my_db'   );
define( 'STORAGE_CHUNK_SIZE',	65535           );
 
include_once( 'index_image.php' );
?>

http://www.acidre.com

Jérôme Renard

Thursday 19 March 2009 6:26:38 am

What happend is you try to call an image (which you know is in the cluster) directly from your browser, like : http://www.site.com/var/xxxx/yyyy/zzz/myimage.ext ?

Do you have any error ?
Anything in error.log ?

Jean-Luc Nguyen

Thursday 19 March 2009 6:35:05 am

For http://www.site.com/var/xxxx/yyyy/zzz/myimage.ext, the error.log file shows "The file does not exist".

http://www.acidre.com

Jean-Luc Nguyen

Thursday 19 March 2009 7:04:18 am

It seems that this is the Rewriterule on apache that is not applied, when I error_log on index_cluster.php, it doesn't show up on error.log.

I don't understand what is wrong with my vhost configuration:

<VirtualHost *:80>
ServerAdmin xx@xx.fr
ServerName xx.localhost

DocumentRoot "xx_path"
DirectoryIndex index.php

<Directory "xx_path">
Options FollowSymLinks
AllowOverride None
</Directory>

RewriteEngine On
    	
RewriteRule content/treemenu/? /index_treemenu.php [L]
Rewriterule ^/var/storage/.* - [L]
Rewriterule ^/var/[^/]+/storage/.* - [L]
RewriteRule ^/var/cache/texttoimage/.* - [L]
RewriteRule ^/var/[^/]+/cache/texttoimage/.* - [L]
Rewriterule ^/design/[^/]+/(stylesheets|images|javascript|swf)/.* - [L]
Rewriterule ^/share/icons/.* - [L]
Rewriterule ^/extension/[^/]+/design/[^/]+/(stylesheets|images|swf|javascripts?)/.* - [L]
Rewriterule ^/packages/styles/.+/(stylesheets|images|swf|javascript)/[^/]+/.* - [L]
RewriteRule ^/packages/styles/.+/thumbnail/.* - [L]
RewriteRule ^/favicon\.ico - [L]
RewriteRule ^/robots\.txt - [L]
RewriteRule ^/info\.php - [L]

RewriteRule ^/var/[^/]+/cache/public/(stylesheets|javascript)/.* - [L]

# Uncomment the following lines when using popup style debug.
# RewriteRule ^/var/cache/debug\.html.* - [L]
# RewriteRule ^/var/[^/]+/cache/debug\.html.* - [L]

# mode cluster
Rewriterule ^/var/([^/]+/)?storage/images-versioned/.*  /index_cluster.php  [L]
Rewriterule ^/var/([^/]+/)?storage/images/.*            /index_cluster.php  [L]

RewriteRule .* /index.php

ErrorLog logs/groupama-am-error_log
CustomLog logs/groupama-am-access_log combined

</VirtualHost>

http://www.acidre.com

Jean-Luc Nguyen

Thursday 19 March 2009 7:29:21 am

OK, I have found, I had to put first:

Rewriterule ^/var/([^/]+/)?storage/images-versioned/.*  /index_cluster.php  [L]
Rewriterule ^/var/([^/]+/)?storage/images/.*            /index_cluster.php  [L]

Before rhe Rewriterule:

Rewriterule ^/var/[^/]+/storage/.* - [L]

=)

http://www.acidre.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 02:14:32
Script start
Timing: Jan 18 2025 02:14:32
Module start 'layout'
Timing: Jan 18 2025 02:14:32
Module start 'content'
Timing: Jan 18 2025 02:14:33
Module end 'content'
Timing: Jan 18 2025 02:14:33
Script end

Main resources:

Total runtime1.2937 sec
Peak memory usage4,096.0000 KB
Database Queries69

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0083 588.0313152.6406
Module start 'layout' 0.00830.0034 740.671939.4766
Module start 'content' 0.01171.2804 780.1484606.2969
Module end 'content' 1.29210.0016 1,386.445320.1406
Script end 1.2937  1,406.5859 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00340.2610160.0002
Check MTime0.00130.1038160.0001
Mysql Total
Database connection0.00110.081610.0011
Mysqli_queries1.218494.1788690.0177
Looping result0.00080.0604670.0000
Template Total1.256497.120.6282
Template load0.00200.153920.0010
Template processing1.254496.959920.6272
Template load and register function0.00010.007110.0001
states
state_id_array0.00120.093210.0012
state_identifier_array0.00100.073920.0005
Override
Cache load0.00180.1371410.0000
Sytem overhead
Fetch class attribute can translate value0.00080.059120.0004
Fetch class attribute name0.00190.146390.0002
XML
Image XML parsing0.00100.080620.0005
class_abstraction
Instantiating content class attribute0.00000.0031140.0000
General
dbfile0.00110.0834240.0000
String conversion0.00000.000740.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
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
12content/datatype/view/ezxmltags/paragraph.tpl<No override>extension/ezwebin/design/ezwebin/templates/content/datatype/view/ezxmltags/paragraph.tplEdit templateOverride template
6content/datatype/view/ezxmltags/literal.tpl<No override>extension/community/design/standard/templates/content/datatype/view/ezxmltags/literal.tplEdit templateOverride template
1content/datatype/view/ezxmltags/line.tpl<No override>design/standard/templates/content/datatype/view/ezxmltags/line.tplEdit templateOverride template
1print_pagelayout.tpl<No override>extension/community/design/community/templates/print_pagelayout.tplEdit templateOverride template
 Number of times templates used: 35
 Number of unique templates used: 7

Time used to render debug report: 0.0002 secs