Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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
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


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.