Expand my Community achievements bar.

SOLVED

AEM reading from Mongo secondaries

Avatar

Level 3

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.

1 Accepted Solution

Avatar

Correct answer by
Level 3

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" 

View solution in original post

2 Replies

Avatar

Correct answer by
Level 3

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" 

Avatar

Level 1

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