I would like to know if it is possible to have one mongoDB instance that belongs to two replica sets.
E.g: ReplicaSet1 has members 10.10.1.1 and 10.10.2.1 ReplicaSet2 has members 10.10.1.1, 10.10.1.2 and 10.10.1.3
A replica set can have up to 50 members but only 7 voting members.
How many types of members exist in replica set? Explanation: There are two members in replica set-primary and secondary.
MongoDB supports replica sets, which can have up to 50 nodes.
MongoDB achieves replication by the use of replica set. A replica set is a group of mongod instances that host the same data set. In a replica, one node is primary node that receives all write operations. All other instances, such as secondaries, apply operations from the primary so that they have the same data set.
No, a single mongod server can not be a member of multiple replica sets. This doesn't seem to be explicitly documented anywhere, so I had to look for something that at least strong implies it. First, every replica in the set has the same databases and collections, and this is maintained by the secondaries replaying the oplog of the primary. A secondary wouldn't be able to replay the oplog from multiple primaries. Second, the db.serverStatus()
command returns a document that contains a repl object with the replication status, and it is an object, not an array.
The only way to have a single machine be a member of multiple replica sets is to run multiple mongod servers on that machine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With