AEM + Mongo failover not working | AEM 6.2 MongoDB 3.2.x

Issue

When you have a multi-node AEM + MongoDB cluster and you shut down the MongoDB primary node and allow failover, then AEM throws errors on all cluster nodes.

Environment

AEM 6.2 + Oak 1.4.15 or earlier

Cause

This is a known issue with AEM + Oak 1.4.15 (and earlier Oak versions).

Resolution

  1. Update to Oak 1.4.16 or later Oak version as provided here.

  2. Set socketTimeoutMS=60000 in the mongouri, for example:

    #mongodb connection options
    CQ_JVM_OPTS="${CQ_JVM_OPTS} -Doak.documentMK.maxServerTimeDiffMillis=31000 -Doak.mongo.uri=mongodb://aemuser:redacted@mongo1host:27017,mongo2host:27017,mongo3host:27017/aem-author?authsource=aem-author&authMechanism=MONGODB-CR&replicaSet=aem&readPreference=nearest&w=2&socketTimeoutMS=60000 -Doak.mongo.db=aem-author"
  3. Add socketKeepAlive=true in DocumentNodeStoreService configuration. For example:

    # This file contains DocumentNodeStoreService configurations and information relating to the apps connection to the Mongo DB
    customBlobStore=B"true"
    maxReplicationLagInSecs=L"21600"
    blobCacheSize=I"16"
    cache=I"16384"
    cacheSegmentCount=I"16"
    cacheStackMoveDistance=I"16"
    nodeCachePercentage="50"
    prevDocCachePercentage="10"
    childrenCachePercentage="20"
    diffCachePercentage="15"
    docChildrenCachePercentage="2"
    persistentCache="./crx-quickstart/repository/cache,size\=2048,binary\=0"
    journalGCInterval=L"300000"
    journalGCMaxAge=L"21600000"
    journalGcBatchSize=I"100"
    blobGcMaxAgeInSecs=L"86400"
    socketKeepAlive=B"true"

 Adobe

Get help faster and easier

New user?

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX 2024

Adobe MAX
The Creativity Conference

Oct 14–16 Miami Beach and online

Adobe MAX

The Creativity Conference

Oct 14–16 Miami Beach and online