ibexa

Path

ez publish / technical manual / 4.5 / features / clustering / reverting a cluster setup


Caution: This documentation is for eZ Publish legacy, from version 3.x to 5.x.

  • Reverting a cluster setup

    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=eZDBFileHandlerMysqliBackend
    #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 (14/09/2010 12:35 pm)

    Geir Arne Waaler (08/11/2011 8:58 am)

    Ester Heylen, Geir Arne Waaler


    Comments

    There are no comments.