Hi,

I just committed some files to implement a first approach to
clustering in jackrabbit. Inside this approach, all repositories in
the cluster share the persistence layer (e.g. a derby database started
standalone). When a repository commits some changes, it will write a
log record to a shared "journal" directory. Another repository
watching that directory will eventually read this record, invalidate
its internal caches and fire corresponding events.

In order to enable clustering on some repositories, do the following
for each repository:

(1) Configure persistence managers with sharable data sources, e.g. standalone
    databases instead of embedded ones
(2) Add a configuration entry to the end of your repository's repository.xml:

<Cluster id="nodeX" >
 <Journal class="org.apache.jackrabbit.core.cluster.FileJournal">
   <param name="directory"  value="/mnt/journal"/>
   <param name="revision" value="${rep.home}/repository/revision" />
 </Journal>
</Cluster>

   This will make the repository write changes to the directory
"/mnt/journal" and read
   changes made by others in the cluster. Make sure that every
repository will get
   a different value for the "id" attribute. Alternatively, you may
set the system
   property named "org.apache.jackrabbit.core.cluster.node_id" to
your preferred
   value.

Features still missing in the current implementation are:

- Automatic archival of journal log entries to save space
- Using a database as backend for the journal
- And probably a lot more...

The status of those features can be tracked here:

https://issues.apache.org/jira/browse/JCR-623

Kind regards
Dominique Pfister

Reply via email to