Does MongoDB support multi-master replication, or how can we configure multi-master replication ourselves?

236 views
Skip to first unread message

MongoDB DBA

unread,
Sep 29, 2015, 8:51:51 PM9/29/15
to mongodb-user
Hi, We need to synchronize data between two data center, how can we do this? Thanks.

badi

unread,
Sep 30, 2015, 2:14:17 PM9/30/15
to mongodb-user, yu...@pearson.com
Hi, 

if your application can manage the insert/update - conflicts of the same document (by f.e. centre:1, centre:2 field) , then you can use Master-Slave function.

The trick is to start both mongod with --master --slave parameter and add --source hostnameDataCentre_1 for mongod in DataCentre_2, and --source hostnameDataCentre_2 for mongod running in DataCentre_1.

I recommend to test that on local pc to simulate all possible issues before moving to production. Also bear in mind this solution is not officially documented thus looks like not officially supported.

( Apart from successful running of MultiMaster functionality for more than 2 years, we also use a bit more enhanced Master-Slave functionality and synchronizing 5 Master mongod instances (different databases) into 1 Central Archive mongod instance )

Ciao \ badi

MongoDB DBA

unread,
Oct 1, 2015, 4:04:41 PM10/1/15
to mongodb-user, yu...@pearson.com
Hi, Thanks badi, this is really useful.


Reply all
Reply to author
Forward
0 new messages