mongodb org.apache.jackrabbit.oak.plugins.document.Document.config proper syntax on AEM 6.5 | Community
Skip to main content
AndreaB69
March 30, 2021
Solved

mongodb org.apache.jackrabbit.oak.plugins.document.Document.config proper syntax on AEM 6.5

  • March 30, 2021
  • 4 replies
  • 1859 views

Hello,

we have issues with aem not recognising db name and url from config file on aem 6.5

I saw in this url

https://experienceleague.adobe.com/docs/experience-manager-64/deploying/introduction/aem-with-mongodb.html

this syntax

 

mongodburi=mongodb://aem:aempassword@mongodbserver1.customer.com:27000,mongodbserver2.customer.com:27000
#Name of MongoDB database to use
db=aem
#Store binaries in custom BlobStore e.g. FileDataStore
customBlobStore=true
 
while this
 
is suggesting this syntax with mongouri (instead of mongodburi ) boolean type and quotes:
 
#Mongo server details
mongouri="mongodb://localhost:27017"

#Name of Mongo database to use
db="aem-author"

#Store binaries in custom BlobStore
customBlobStore=B"false"
 
which is the right one on the latest AEM 6.5 ?
any idea why the config file might not be applied?
 
Thanks
 
 
This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by user05162

First, Make sure you are using .config and not .cfg for configuration files, and the syntax was also changed from :

 

 

# org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.cfg

#MongoDB server details
mongodburi=mongodb://aem:aempassword@mongodbserver1.customer.com:27000],mongodbserver2.customer.com:27000#Name of MongoDB database to use
db=aem
#Store binaries in custom BlobStore e.g. FileDataStore
customBlobStore=true
cache=2048
blobCacheSize=1024

 To

#org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.config

#Mongo server details mongouri="mongodb://aem:aempassword@mongodbserver1.customer.com:27000],mongodbserver2.customer.com:27000" #Name of Mongo database to use 
db="aem"  
#Store binaries in custom BlobStore 
customBlobStore=B"true"
cache=I"2048" 
blobCacheSize=I"1024"

4 replies

user05162Adobe EmployeeAccepted solution
Adobe Employee
March 30, 2021

First, Make sure you are using .config and not .cfg for configuration files, and the syntax was also changed from :

 

 

# org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.cfg

#MongoDB server details
mongodburi=mongodb://aem:aempassword@mongodbserver1.customer.com:27000],mongodbserver2.customer.com:27000#Name of MongoDB database to use
db=aem
#Store binaries in custom BlobStore e.g. FileDataStore
customBlobStore=true
cache=2048
blobCacheSize=1024

 To

#org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.config

#Mongo server details mongouri="mongodb://aem:aempassword@mongodbserver1.customer.com:27000],mongodbserver2.customer.com:27000" #Name of Mongo database to use 
db="aem"  
#Store binaries in custom BlobStore 
customBlobStore=B"true"
cache=I"2048" 
blobCacheSize=I"1024"
Adobe Employee
March 30, 2021
AndreaB69
AndreaB69Author
March 30, 2021

Thanks !
do you have a mongouri sample with repilicaset and authentication with authSource?

 

Adobe Employee
March 30, 2021

You can check [1] for more details on the connection string options

 

[1] https://docs.mongodb.com/manual/reference/connection-string/

 

AndreaB69
AndreaB69Author
March 30, 2021

Hi ,

my experience is that with a connection string containg replicaset like mongodb://mongouser:password@mongoserver1:27000/DBNAME?replicaSet=replicaset&authSource=source
the config file org.apache.jackrabbit.oak.plugins.document.DocumentNodeStoreService.config   is ignored  if it contains that mongouri.

If we specify the uri in  -Doak.mongo.uri   in  CQ_JVM_OPTS in startup script it is correctly applied and even parameters in  config file like db name or customBlobStore are correcty applied.
Is it possibile that some kind of parsing of uri  in config file  fails in case of replicaset and prevents using it?