2

I am looking for a method to configure MongoDB servers across 2 different datacenters where they remain in an active-active configuration. Site A is the normal Production environment that customers access and all writes are sent here, but all data writes are also replicated to site B, which is the backup. Furthermore, site B should also be able to accept any writes and replicate that to site A. In the DR situation, and site A is gone, site B would have the complete data set and be switched to instantly (DNS only most likely) and nothing would need to be changed via the application.

I've done quite a bit of searching and I have yet found a solution. The closest I've found is sharded cluster, but that would require setting up multiple shards and each with replica-set and criss-cross where each replica-set is located between site A and B. This would also mean that regular writes to a shard with the primary Mongo instance located in the other datacenter to be traversing networks and be considerably slower.

1

1 Answer 1

1

What you are asking for is "master-master replication"; MongoDB does not support this, it only supports primary-secondary replication:

Replication in MongoDB

A replica set is a group of mongod instances that maintain the same data set. A replica set contains several data bearing nodes and optionally one arbiter node. Of the data bearing nodes, one and only one member is deemed the primary node, while the other nodes are deemed secondary nodes.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .