Take the 2-minute tour ×

I have 2 databases in my mongo DB namespace, lets name them db1, db2 and db3 which are on the same dbpath. Is it possible to configure mongo db replica set in that way that db3 wont be replicated across secondaries?

If yes, how?

share|improve this question

2 Answers 2

up vote 3 down vote accepted

No, to the best of my knowledge this is not possible. A replica set member is identified by a hostname and port, and there are no settings to control which databases are included. See Replica Set Configuration in the MongoDB manual.

You could create a separate MongoDB server instance configured on a different port (and using a different dbpath) to hold the db3 data, although this would obviously complicate your server setup.

share|improve this answer
I was afraid that this might work like this - as I did not find anything in manuals. –  maciejmrowiec Jan 30 '13 at 17:51

MongoDB replication is handled by host and port, which is per-mongod-process.

The way to do this would be to run db3 run in another mongod process, which runs on a different tcp port.

share|improve this answer

Your Answer


