Reputation: 63
I need suggestions on the clustering of jack rabbit like this, can anyone provide the references.
There is server 1&2 and jackrabbit server 1 & 2 are there. Every jack rabbit server created one jack rabbit folder.
If server1 access jack rabbit server 2, required content are not available. How can I achieve this functionality.
Upvotes: 1
Views: 1226
Reputation: 3146
The scenario of having 2 servers is pretty common. It's all a matter of configuring Apache Jackrabbit to set this up. For clarity I assume you're using Apache Jackrabbit 2.x and not OAK.
With Jackrabbit 2 you can configure clustering between 2 servers in two ways:
Using a network share
You can use a shared network drive. In your Jackrabbit repository configuration (repository.xml) you will need to configure the cluster element based on a FileJournal.
<Cluster id="node1">
<Journal class="org.apache.jackrabbit.core.journal.FileJournal">
<param name="revision" value="${rep.home}/revision.log" />
<param name="directory" value="/nfs/myserver/myjournal" />
</Journal>
</Cluster>
Using a database
You can use a database to share the content and the journal (required for synching the different repositories. In the below example we'll use Oracle, but it could be any kind of RDBMS.
<Cluster id="node1" syncDelay="2000">
<Journal class="org.apache.jackrabbit.core.journal.OracleDatabaseJournal">
<param name="revision" value="${rep.home}/revision.log" />
<param name="driver" value="oracle.jdbc.driver.OracleDriver" />
<param name="url" value="jdbc:oracle:thin:@myhost:1521:mydb" />
<param name="user" value="scott"/>
<param name="password" value="tiger"/>
</Journal>
</Cluster>
In both cases it's very important to set a different ID on the Cluster element, so that Jackrabbit knows which nodes still needs to be updated.
See the Apache Jackrabbit Clustering page for more information.
Upvotes: 3