3

I have created a database and a user with oplog access in Compose.io.

The URI I get looks like this:

mongodb://<user>:<password>@lamppost.11.mongolayer.com:10022,lamppost.10.mongolayer.com:10024/cardmaker?replicaSet=set-<bunchOfDigits>

Knowing this, what do I set as MONGO_URL and MONGO_OPLOG_URL in mup.json?

There is literally no documentation on this. :(

Stennie
  • 63,885
  • 14
  • 149
  • 175
Yeats
  • 2,112
  • 3
  • 30
  • 46

1 Answers1

6

Let's say database name: mydatabase username: user password: 123456

It will be looked like this:

 “MONGO_URL”: “mongodb://user:123456@candidate.11.mongolayer.com:10240,candidate.0.mongolayer.com:10240/mydatabase?replicaSet=set-0123456789″,
 “MONGO_OPLOG_URL”: “mongodb://user:123456@candidate.11.mongolayer.com:10240,candidate.0.mongolayer.com:10240/local?authSource=mydatabase”

Source: Meteor Up Apps Deployment and Oplog-tailing

Kai Feng Chew
  • 779
  • 8
  • 24
  • I've always used `/local?authSource=mydatabase&replicaSet=set-0123456789` for the oplog. But curious if the replicaSet param is required for the oplog to continue to work after a step down? – Mikael Lirbank Oct 28 '15 at 16:40
  • @MikaelLirbank I forgot if the "/local?authSource=mydatabase&replicaSet=set-0123456789" will work. What's your result? But I'm 100% sure that "/local?authSource=mydatabase" is working fine. – Kai Feng Chew Oct 29 '15 at 05:16
  • 2
    It works well. I actually asked Compose.io support about the "?replicaSet" param for the MONGO_URL (not the OPLOG) a while ago and they said you actually don't need it at all. Most drivers are able to figure out the replica set without it. So I skipped it on both the URLs, but then there was a stepdown recently and my Meteor app had problems coping with it. So now I've added the replicaSet param for both MONGO_URL and MONGO_OPLOG_URL again. – Mikael Lirbank Nov 02 '15 at 05:13