Monday, November 14, 2011

How to mount DataStore in different directory in CQ / WEM

Use Case : You have huge datastore and want to mount it on different directory Or Online backup takes a lot of time including datastore and you want to do separate backup for datastore

Solution : Here is process for how to separate Datastore and then do separate online backup

Assuming your repository is under /mnt/crx/repository and you want to move your datastore to /mnt/crx/datastore

1. stop the crx instance
2. mv /mnt/crx/repository/shared/repository/datastore /mnt/crx/
3. Then modify repository.xml by adding the new path configuration to the DataStore element.

Before:
<DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
<param name="minRecordLength" value="4096"/>
</DataStore>

After:
<DataStore class="org.apache.jackrabbit.core.data.FileDataStore">
<param name="path" value="/mnt/crx/datastore"/>
<param name="minRecordLength" value="4096"/>
</DataStore>

4. Start CRX

After doing this then you can safely run separate backups on the datastore while the system is running without affecting performance very much.

Following our example, you could use this command to backup the datstore:
rsync --av --ignore-existing /mnt/crx/datastore /mnt/backup/datastore

Information about rsync can be found here http://ss64.com/bash/rsync.html

3 comments:

  1. If we mount datastore in different directory outside repository , definitely online back up time will improve , but what about search? How will it impact asset search within the repository?

    ReplyDelete
    Replies
    1. Hello,

      It will not effect asset search at all. Search information for asset is stored as index (Lucene) under /repository/repository/index

      Yogesh

      Delete