AEM 6.x mongo-backed clustered author setup
There’s been a bit of internal discussion regarding the setup and load test of AEM 6.x (with specific interest on 6.1) with Mongo as persistence storage. The following outlines the instantiation and configuration of a (2) node AEM Author cluster backed by a (3) member mongo replica set consisting of PRIMARY, SECONDARY, and ARBITER cluster members.
INITIAL AEM AUTHOR CONFIGURATION, STAND-ALONE MONGO CONFIGURATION
- Create directory to store AEM author instance 0, e.g.:
author0
- Create directory a stand-alone directory for mongo storage (we’ll later convert this), e.g.:
mongo0
- Start mongo on the default port
27017
, executing:mongod --dbpath mongo0/
- Copy or sym-link to AEM jar, license file within
author0
and unpack. Execute:java -jar cq-quickstart-beta-6.1.0-load23-preload1.jar -unpack
- Modify script to use CRX3 Mongo, and point to stand-alone instance initiated in Step #3
- Append runmode
crx3mongo
- Append mongo connection details via JVM argument key:
oak.mongo.uri
value:mongodb://localhost:27017
- Start AEM and wait for installation to complete
PREPARE FOR REPLICA SET CONFIGURATION
- Shutdown AEM
- Shutdown mongod running from
mongo0
on port27017
DEFINE MONGO REPLICA SET
- Create a directory for mongo replica set node 2, e.g.:
mongo1
- Create a directory for mongo replica set, arbiter node, e.g.:
mongo2_arb
- Start the stand-alone mongo instance with the
replSet
option set toaem6
, e.g.:mongod --dbpath mongo0/ --replSet aem6
- Start the node 2 mongo instance, e.g.:
mongod --dbpath mongo1/ --replSet aem6 --port 27018
- Start the arbiter mongo instance, e.g.:
mongod --dbpath mongo2_arb --replSet aem6 --port 27019
- Open a mongo shell and complete the replica set definition
- Initialize the replica set:
rs.initiate(rsconf = {_id: "aem6", members: [{_id: 0, host: "localhost:27017"}]})
- Add replica 2:
rs.add("localhost:27018")
- Add the arbiter:
rs.addArb("localhost:27019")
- Check status, wait until you have a PRIMARY, SECONDARY, and ARBITER node:
rs.status()
UPDATE INITIAL AEM AUTHOR INSTANCE MONGO
- Modify AEM start script to point to additional, non-arbiter node
- Append host and port (e.g.
localhost:27018
) of additional node via JVM argument keyoak.mongo.uri
. Host:ports are comma delimited. The value ofoak.mongo.uri
should now equalmongodb://localhost:27017,localhost:27018
- Start AEM Author
DEFINE ADDITIONAL AEM AUTHOR INSTANCE
- Create directory to store AEM author instance 1, e.g.:
author1
- Copy or sym-link to AEM jar, license file within
author1
and unpack. Execute:java -jar cq-quickstart-beta-6.1.0-load23-preload1.jar -unpack
- Modify script to use CRX3 Mongo, and point to stand-alone instance initiated in Step #2
- Append runmode
crx3mongo
- Change bind port from
4502
to5502
- Append mongo connection details via JVM argument key:
oak.mongo.uri
value:mongodb://localhost:27017,localhost:27018
- Start AEM and wait for installation to complete
SHUTDOWN PROCEDURES
- Shutdown all AEM instances
- Shutdown all MongoDB instances