AEM 6.2 MongoDB(Enterprise V3.2.2) integration not working | Community
Skip to main content
Level 3
June 12, 2017

AEM 6.2 MongoDB(Enterprise V3.2.2) integration not working

  • June 12, 2017
  • 2 replies
  • 16961 views

Hi All,

I am in progress of developing an POC of AEM 6.2(with SP1) author cluster integrated with Mongodb (Enterprise v3.2.2) replica set . The goal which i want to achieve is create two AEM instances pointing to MongoDB replica (primary,secondary,Arbiter)

The issue which i am facing is First instance is coming up fine and able to login successfully and the second AEM instance has start up issues and i see jetty not coming up.


The steps which i followed are

MongoDB setup:

1. Create an Mongo DB replica , primary on 27017, secondary on 27018 and Arbiter on 27019. Started the mongo with

mongod --dbpath c:\POC-AEM-MONGOReplica\aem\aem-primary\mongo0\ --replSet aem6 --port 27017

mongod --dbpath c:\POC-AEM-MONGOReplica\aem\aem-secondary\mongo1\ --replSet aem6 --port 27018

mongod -dbpath c:\POC-AEM-MONGOReplica\aem\aem-secondary\mongo2_arb\ --replSet aem6 --port 27019

AEM Primary setup:

1. Unpack the AEM jar

2. add configuration org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.cfg to install folder under crx-quickstart folder

the configuration has updated with  mongouri=mongodb://localhost:27017,localhost:27018/?replicaSet=rs0, db=aem_mongo and other configs

3. started the AEM instance by running "java -jar aem6.2-author-p9001.jar -r crx3,crx3mongo"  from command line

4. All bundles are up and database has been created in Mongo DB and able to Login successfully.

AEM Secondary setup:

1. Unpack the AEM jar

2. add configuration org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.cfg to install folder under crx-quickstart folder

the configuration has updated with  mongouri=mongodb://localhost:27017,localhost:27018/?replicaSet=rs0, db=aem_mongo and other configs

3. started the AEM instance by running "java -jar aem6.2-author-p9002.jar -r crx3,crx3mongo"  from command line

4. Only few bundles are up and lots of errors in the logs and instance is not up.

*ERROR* [FelixStartLevel] ERROR: Bundle '154' Error starting launchpad:resources/install/0/com.adobe.cq.projects.core-0.2.80.jar

*ERROR* [FelixStartLevel] ERROR: Bundle '155' Error starting launchpad:resources/install/0/com.adobe.cq.projects.ui-0.2.2.jar

*ERROR* [FelixStartLevel] ERROR: Bundle '156' Error starting launchpad:resources/install/0/com.adobe.cq.projects.wcm.core-0.2.10.jar.....

......

*ERROR* [FelixStartLevel] ERROR: Bundle '283' Error starting launchpad:resources/install/0/cq-workflow-impl-6.0.26.jar

Caused by: java.lang.ClassNotFoundException: Unable to load class 'org.eclipse.jetty.io.WriteFlusher$1' because the bundle wiring for org.apache.felix.http.jetty is no longer valid

can you please let me know if i am missing any steps in configuring the steps.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.

2 replies

edgarn27224967
June 12, 2017

Been a while since I've done this on 6.2, but I have a memory that one had to not only define the mongo stuff in the org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.cfg config file, but also the following two arguments on the java command line itself:

-Doak.mongo.uri=XXX -Doak.mongo.db=YYY

KishCq5Author
Level 3
June 13, 2017

Hi edgarm,

thanks for the reply. i tried adding the mongo.uri and db details as arguments while starting the AEM still the second instance is not starting properly

java -jar aem6.2-author-p8001.jar -r crx3,crx3mongo -Doak.mongo.uri=mongodb://localhost:27017,localhost:27018 -Doak.mongo.db=aem_mongo_test

can you please let me know the steps you followed for the successful setup.

KishCq5Author
Level 3
June 13, 2017

Hi Experts,

can you please check and let me know if i am missing any steps in order to execute successful AEM with MongoDB integration. 

Level 2
June 13, 2017

Last time I was creating a cluster on 6.1 and I was executing the following steps. I have tried others as well, but this one worked multiple times.

1. Download and install MongoDB (add {mongo-install-directory}\bin to PATH)

2. Create a directory for the 1st instance (ex: author0)

3. create a directory for mongo replica set node 1 (ex: mongo0)

4. Start mongo on default port (27017) with the following command: mongod --dbpath mongo0/

5. Extract the installer JAR file with java -jar {AEM-installer.jar} -unpack

6. Modify the start.bat as follows:

  •   add crx3mongo to CQ_RUNMODE,
  •   comment out set CQ_RUNMODE=%CQ_RUNMODE%,crx3,crx3tar
  •   uncomment set CQ_RUNMODE=%CQ_RUNMODE%,crx3,crx3mongo
  •   uncomment the settings for mongo db
    •   set CQ_MONGO_HOST=localhost
    •   set CQ_MONGO_PORT=27017
    •   set CQ_MONGO_DB=aem6

7. Start AEM and wait for the installation to complete

8. Stop AEM, Stop Mongo

9. Set up the mongo replica set:

  •   create a directory for mongo replica set node 2 (ex: mongo1)
  •   create a directory for the arbiter node (ex: mongo_arb)
  •   Start the stand-alone mongo instance with the replSet option set to aem6, 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 (if path variable is set properly you only need to type mongo in command line) and complete the replica set definition
    •   Initialize the replica set by: 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()

10. Update the start.bat, add the 2nd node's port to CQ_MONGO_PORT (CQ_MONGO_PORT=27017,27018)

11. Install the second AEM node:

  •   Create a directory to store the AEM instance (ex: author1)
  •   Execute steps from 5 to 7.

12. Check the topology by hitting: http://localhost:4502/system/console/status-topology

13. Start up process:

  •   Repeat steps from 9/c to 9/e
  •   Start 1st AEM node
  •   Start 2nd AEM node

14. Shut down process: Stop AEM instances, Stop MongoDB instances.

KishCq5Author
Level 3
June 13, 2017

Hi nschuter,

Thanks for the steps i tried following the same

1. started mongo instance in 27017

2. unpacked the jar

3. updated the mongo configurations in start.bat of AEM

4. started the AEM from command line start.bat

AEM is not coming up properly and i See error below in the logs. Only few bundles are in Active state.

13.06.2017 12:35:15.389 *ERROR* [FelixStartLevel] ERROR: Bundle '36' Error stopping launchpad:resources/install/5/org.apache.felix.http.jetty-3.1.6-B002.jar (java.util.NoSuchElementException)

I am using the AEM 6.2 version and i am not sure what i am missing