Forums / Install & configuration / Cluster mode on eZ 4.0.3 [SOLVED]

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

eZ debug

Timing: Jan 17 2025 23:41:57
Script start
Timing: Jan 17 2025 23:41:57
Module start 'content'
Timing: Jan 17 2025 23:41:57
Module end 'content'
Timing: Jan 17 2025 23:41:58
Script end

Main resources:

Total runtime0.6929 sec
Peak memory usage4,096.0000 KB
Database Queries206

Timing points:

CheckpointStart (sec)Duration (sec)Memory at start (KB)Memory used (KB)
Script start 0.00000.0063 587.8281180.8281
Module start 'content' 0.00630.5563 768.6563611.3906
Module end 'content' 0.56260.1302 1,380.0469345.0625
Script end 0.6928  1,725.1094 

Time accumulators:

 Accumulator Duration (sec) Duration (%) Count Average (sec)
Ini load
Load cache0.00370.5313210.0002
Check MTime0.00140.2025210.0001
Mysql Total
Database connection0.00090.131210.0009
Mysqli_queries0.603887.14372060.0029
Looping result0.00230.32772040.0000
Template Total0.662295.620.3311
Template load0.00190.268920.0009
Template processing0.660395.287820.3301
Template load and register function0.00010.014310.0001
states
state_id_array0.00080.113010.0008
state_identifier_array0.00090.135520.0005
Override
Cache load0.00160.2369410.0000
Sytem overhead
Fetch class attribute can translate value0.00200.288230.0007
Fetch class attribute name0.00260.381490.0003
XML
Image XML parsing0.00110.157530.0004
class_abstraction
Instantiating content class attribute0.00000.0043140.0000
General
dbfile0.00310.4532350.0001
String conversion0.00000.000830.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
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
1pagelayout.tpl<No override>extension/sevenx/design/simple/templates/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