Running Multiple CMS Instances with Cargo Using a Shared Repository (Local Clustered Setup)
This guide explains how to run multiple Bloomreach Content CMS instances locally with Cargo, using a single shared repository. This setup is useful for local testing of clustered deployments.
Prerequisites
- Two separate checkouts of the same Bloomreach Content project in different directories.
- MySQL installed and accessible for use as the repository database.
- Maven installed.
Steps
-
Clone the Project Twice
Check out the same project into two different directories on your local machine.
-
Configure Tomcat for Multiple Instances
In one of the checkouts, follow the instructions in Run 2 Bloomreach Content instances of Tomcat simultaneously to configure Tomcat for multiple running instances.
-
Configure MySQL for Both Instances
In both checkouts, follow the steps in Use MySQL in a Development Environment to set up MySQL as the repository database.
-
Update
repository.xmlfor ClusteringIn each project directory, update the
repository.xmlfile to enable clustering. Add the following<Cluster>configuration to both files:<Cluster> <Journal class="org.apache.jackrabbit.core.journal.JNDIDatabaseJournal"> <param name="revision" value="${rep.home}/revision.log"/> <param name="url" value="java:comp/env/jdbc/repositoryDS"/> <param name="driver" value="javax.naming.InitialContext"/> <param name="schemaObjectPrefix" value="repository_"/> <param name="schema" value="mysql"/> </Journal> </Cluster> -
Start Both Instances with Cargo
In each project directory, start the CMS instance using:
mvn -P cargo.run
Verification
- Both CMS instances should start and connect to the shared MySQL repository.
- Changes made in one instance should be visible in the other, confirming that clustering is working as expected.
Troubleshooting
- Ensure both instances use the same database and have identical cluster configuration in
repository.xml. - Check for port conflicts in Tomcat configuration if either instance fails to start.
- Review the logs for any repository connection errors.