In eXo Platform, the persistence mostly relies on JCR, which is a middleware between the eXo Platform applications (including the Portal) and the database. Hence, this component must be configured to work in the cluster mode.

The embedded JCR server requires a portion of its state to be shared on a file system shared among the cluster nodes:

All nodes must have the read/write access to the shared file system.

To set up the cluster in eXo Platform:

1. Switch to a cluster configuration.

This step is done in the configuration.properties file. This configuration.properties file must be set in the same way on all the cluster nodes.

First, point the exo.shared.dir variable to a network directory shared between cluster nodes.

The path is shared, so all nodes will need the read/write access to this path.

Then, switch the JCR to the cluster mode.

In this step, JCR enables the automatic network replication and discovery between other cluster nodes.

2. Switch to the cluster profile. You need to indicate the cluster kernel profile to eXo Platform. This can be done by editing gatein.sh as below:

or use the start_eXo script:

3. Do the initial startup.

For the initial startup of your JCR cluster, you should only start a single node. This node will initialize the internal JCR database and create the system workspace. Once the initial node is definitely started, you can start the other nodes.

4. Start up and shut down.

Nodes of the cluster will automatically try to join others at startup. Once they have discovered each other, they will synchronize their state. During the synchronization, the node is not ready to serve requests.

The cluster mode is preconfigured to work out of the box. The eXo Platform clustering fully relies on the JBossCache replication which uses JGroups internally.

The default configuration of JBossCache lies in exo.portal.component.common-x.x.x.jar.

Since eXo Platform 3.5-M3, the JCR's JBossCache default configuration is externalized to the $CATALINE_HOME/gatein/conf/jcr/jbosscache folder.

The JBossCache configuration is done in the configuration.properties file.

On Tomcat:

On JBoss Application Server:

By default, the nodes discovery is based on UDP, in which JGroups is responsible for the nodes identification through the UDP transport. The administrator can change the configuration of detection and ports in jgroups-udp.xml.