James001
James001

Reputation: 127

MongoDB master/master replication

I want to know how to configure 2 servers Master/Master in MongoDB. I have two server on different location. How can i configure it ?

MongoDB version 4.2 Ubuntu 18.04

Is it possible to connect like mysql ? I mean domain:27017

Upvotes: 2

Views: 711

Answers (1)

Dror
Dror

Reputation: 5505

There can be only one Primary in a replicaset (The primary node is the node that accepts writes/updates/deletes)

If you used sharding (for example so each shard will serve a different set of countries) - then each shard has a primary node to serve specific countries. (Note - The data in seperate shards does not overlap. Each shard will retain different data)

Upvotes: 2

Related Questions