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.