Connecting AEM to mongodb replica set | Community
Skip to main content
Level 3
October 16, 2015
Solved

Connecting AEM to mongodb replica set

  • October 16, 2015
  • 5 replies
  • 1493 views

Has anyone tried connecting AEM 6.0 to a MongoDB replica set? I'm not sure how to specify the replica set here:

-Doak.mongo.uri=mongodb://localhost:27017

That will only connect to one specific mongodb instance. It might be due to my lack of mongodb knowledge, but any extra documentation around this installation would be great.

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 Katrien1

I think I found the information here:

Although it would still be nice if someone could give me an example here as well. Or if documentation was updated to explain how to connect to replica set.

5 replies

Katrien1AuthorAccepted solution
Level 3
October 16, 2015

I think I found the information here:

Although it would still be nice if someone could give me an example here as well. Or if documentation was updated to explain how to connect to replica set.

smacdonald2008
Level 10
October 16, 2015
Katrien1Author
Level 3
October 16, 2015

Thanks but that post doesn't explain how to connect to a replica set. Only to an individual mongo instance. But I got it running now using hte documentation given in my earlier post.

Chandra_gupta
Level 4
October 16, 2015
October 16, 2015

It is mentioned on this page: http://jackrabbit.apache.org/oak/docs/osgi_config.html#Mongo_Configuration

It's essentially comma-delimited. E.g. -Doak.mongo.uri=mongodb://localhost:27017,localhost:27018
(You can certainly add more than two instances.)

The example on the above page also gives you some hints about configuring one instance as preferred for writes with the the other as preferred for reads: mongodb://db1.example.net,db2.example.com?readPreference=secondary&readPreferenceTags=dc:ny,rack:1&readPreferenceTags=dc:ny&readPreferenceTags=&w=1&wtimeoutMS=10000