0

I am running a replicaset of three members, i want to ignore a specific database while replicating to secondaries.

Is is possible for mongodb, please help!!

Community
  • 1
  • 1
Abdul Moiz
  • 1,317
  • 2
  • 17
  • 40

2 Answers2

1

No, its not possible to opt out a database from being replicated in a Mongo replication setup.

dilsingi
  • 2,938
  • 14
  • 24
-1

Why do you need a replica set member not to replicate? A replica set is a group of mongod instances that host the same data set, except for arbiters which doesn't host data.

One way is that you can remove the particular database from the replica set.

rs.remove(host:port)

Alternately you can reconfigure the replica set to make the member an arbiter. Specify a different data directory other than the one holding the data in this case.

rs.addArb(host:port)

If the requirement is to carry out some implementation or maintenance activities, in which case you need a backup then consider using Delayed members. Refer this article.

Van Peer
  • 2,127
  • 2
  • 25
  • 35
  • They wanted a specific database to not replicate to secondaries, not for a member to not get any replication traffic at all. – Jason Floyd Jul 11 '23 at 21:37