Path

ezpublish / documentation / ez publish / technical manual / 4.x / features / clustering / reverting a cluster setup


Caution: This documentation is for eZ Publish legacy, from version 3.x to 6.x.
For 5.x documentation covering Platform see eZ Documentation Center, for difference between legacy and Platform see 5.x Architecture overview.

Reverting a cluster setup

This part of the 4.x documentation is for eZ Publish 4.0, only reference section is common for all eZ Publish 4.x versions as well as eZ Publish 5.x "LegacyStack", please select the version you are using for the most up to date documentation!

You can always switch from using the clustering functionality to the standard configuration where images, binary files and content-related caches are stored on a file system. The following instructions explain how this can be done, assuming that your eZ Publish site is currently configured to store images and other files in a MySQL database.

Reverting to non cluster setup

1. Clear the caches (optional)

It is recommended (but not required) to clear all eZ Publish caches before disabling the clustering functionality. This can be done by running the "bin/php/ezcache.php" script as shown below:

$php bin/php/ezcache.php --clear-all --purge

Note that "$php" should be replaced by the path to your php executable.

2. Unclusterize images and other files

You need to copy images, binary files and content-related caches from the database to the file system. This can be done by running the "bin/php/clusterize.php" script with the "-u" parameter. Make sure that you have enough disk space on the file system before starting this operation.

The following example shows how to run the script (replace "ezwebin_site" with the actual name of your siteaccess):

$php bin/php/clusterize.php -u -s ezwebin_site

Note that "$php" should be replaced by the path to your php executable.

The script will go through the files stored in the database and copy them into the appropriate subdirectories of the "var" directory.

3. Modify the "file.ini" settings

Open the "settings/override/file.ini.append.php" configuration file and edit it. Comment all lines located under the [ClusteringSettings] block by adding "#" as shown below:

[ClusteringSettings]
#FileHandler=eZDBFileHandler
#DBBackend=eZDBFileHandlerMysqlBackend
#DBHost=localhost
#DBPort=3306
#DBSocket=
#DBName=name
#DBUser=user
#DBPassword=pass
#DBChunkSize=65535

If the file does not exist in the "settings/override" directory, update the "settings/siteaccess/ezwebin_site/file.ini.append.php" file instead (where "ezwebin_site" is the name of your siteaccess).

Note that you can also remove the entire [ClusteringSettings] block instead of commenting the lines one by one.

By commenting out the entire entry you will revert to the default setting in "settings/file.ini" where the default FileHandler is eZ FS File Handler.

However if you prefer not to add #'s or delete the entry you can also set the FileHandler setting to eZFSFileHandler for the same result.

[ClusteringSettings]
 
FileHandler=eZFSFileHandler

4. (Optional) Disable the script for serving images

Rename or remove the "index_cluster.php" file located in the root directory of your eZ Publish installation. Until now, this script was used to serve images stored in your MySQL database. This step is not required if you properly perform "step 5" and remove the cluster rewrite rules, because once the rewrite rules are removed Apache will no longer use the script anyway.

5. Update the Apache configuration

Comment out or remove the following lines in your ".htaccess" file:

RewriteRule ^/var/([^/]+/)?storage/images-versioned/.*  /index_cluster.php [L]
RewriteRule ^/var/([^/]+/)?storage/images/.*  /index_cluster.php [L]
RewriteRule  ^/var/([^/]+/)?cache/public/(stylesheets|javascript) /index_cluster.php  [L]

If no ".htaccess" file is used, you need to comment out the same lines in the Apache configuration file.

6. Restart Apache and test the site

Restart the Apache web server. After it has been restarted, your site should be using images, binary files and content-related caches stored in the "var" directory. Verify that the site works correctly, content images are displayed and content binary files are accessible (open the site pages in a web browser, log in to the administration interface, try clicking around and so on).

7. Remove the clustering tables from the database

If the site works correctly, you can remove the database tables that were previously used for storing images, binary files and content-related caches. This can be done by executing the following SQL queries:

  • With eZDB
    DROP TABLE ezdbfile;DROP TABLE ezdbfile_data;
  • With eZDFS
    DROP TABLE ezdfsfile;
    Note that the files on the NFS share need to be removed manually.

Changing to another Cluster file handler

1. Revert to non cluster mode

When changing from one cluster file handler to another it is best to first un-cluster by following the steps described in "Reverting to non cluster setup" before changing to another cluster file handler.

2. Setup cluster

Follow the steps described in "Setting it up for an eZ DB FileHandler" or "Setting it up for an eZ DFS FileHandler" to cluster your installation with the new cluster file handler.

Ester Heylen (16/04/2010 1:20 pm)

Ricardo Correia (17/04/2013 2:00 pm)

Ester Heylen, Ricardo Correia


Comments

There are no comments.