AEM reading from Mongo secondaries | Community
Skip to main content
Level 3
October 16, 2015
Solved

AEM reading from Mongo secondaries

Since SP1 AEM now allows reading from MongoDB secondaries. I have a question around the configuration of this. Do I need to explicitely state in the Mongo Config to allow reading from secondaries or is this in the AEM configuration ?

Thanks in advance.

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Katrien1Accepted solution
Level 3
October 16, 2015

For those interested. By default your driver will set Read Preference to Primary only. To change that you need to specify this on the connection string. I am currently experimenting with adding this to my start script "-Doak.mongo.uri.readPreference:secondaryPreferred" 

2 replies

shariq_Feeroz
New Participant
August 3, 2016

Hi Katrien,

Is this setting -Doak.mongo.uri.readPreference:secondaryPreferred is working for you ?.

Is there any alternative way to give this setting with MongoDB connection string. We are using this below connection string in our MongoDB cluster :

mongouri="mongodb://stg_aemauthor:nPfqYMkj9mHKvghZYiZe@mongodbus2.illumina.com:27017,mongodbus:27017,mongodbapac:27017,mongodbemea:27017/$external?authMechanism\=PLAIN&replicaSet\=envrepl"

I want to read from particular mongodb. Is it configurable?

 

Thanks,

Shariq

Translate
Katrien1AuthorAccepted solution
Level 3
October 16, 2015

For those interested. By default your driver will set Read Preference to Primary only. To change that you need to specify this on the connection string. I am currently experimenting with adding this to my start script "-Doak.mongo.uri.readPreference:secondaryPreferred" 

Translate