1. In /modeshape-example-repositories/src/main/resources/configRepository.xml add the line as the documentation prescribes:
<clustering clusterName="modeshape-cluster" configuration="jgroups-modeshape.xml" />:
------------------------------------------------------------------
<?xml version="1.0" encoding="UTF-8"?>
. . .
<configuration xmlns:mode="http://www.modeshape.org/1.0" xmlns:jcr="http://www.jcp.org/jcr/1.0">
<clustering clusterName="modeshape-cluster" configuration="udp.xml"/>
<mode:sources jcr:primaryType="nt:unstructured">
<!--
The 'Cars' repository is an in-memory source with a single default workspace (though others could be created, too).
-->
<mode:source jcr:name="Cars" mode:classname="org.modeshape.graph.connector.inmemory.InMemoryRepositorySource" mode:retryLimit="3" mode:defaultWorkspaceName="workspace1"/>
. . .
------------------------------------------------------------------
2. Run /modeshape-example-repositories/src/main/java/org/modeshape/example/repository/RepositoryClient.java example. The console output will be:
Starting repositories ... done.
-----------------------------------
Menu:
. . .
Clustering does not get enabled.
3. In /modeshape-example-repositories/src/main/resources/configRepository.xml change the line to contain mode:clustering element:
<mode:clustering clusterName="modeshape-cluster" configuration="jgroups-modeshape.xml" />:
4. Run /modeshape-example-repositories/src/main/java/org/modeshape/example/repository/RepositoryClient.java example. The console output will confirm cluster creation:
Starting repositories ... 00:15:04,312 INFO JGroups version: 2.10.0.GA
-------------------------------------------------------------------
GMS: address=sv-45476, cluster=modeshape-cluster2, physical address=192.168.2.3:4672
-------------------------------------------------------------------