4

Can we have this type of configuration?

1)MongoDB - Multiple cluster data synchronizing master to master

2)MongoDB - Multiple cluster DR

3)MongoDB - Multiple cluster Blue-green deployment

2
  • You need to explain a little bit more, what you are looking for. Mongodb cluster (sharding) is normally build using replica sets (one shard is replica set) and nodes of replica set can be distributed to different data centers (different geo locations).
    – JJussi
    May 16, 2018 at 9:04
  • ok... We have mongodb cluser in one data center. We need same mongodb cluster with same data with data sync from mongodb cluster1 like how mysql master to mater replication is happening. 2)MongoDB disaster recovery for multiple cluster. One cluster is live and another cluster is backup with data sync. If cluster1 is down we need to switch cluster2 to live. Thanks in advance.. May 16, 2018 at 9:13

2 Answers 2

2

1)MongoDB - Multiple cluster data synchronizing master to master

As MongoDB jira documentation Why was MongoDB not designed to have master-master replication actually, don't think master-master perform better than master-slave. but it indeed easy to scale out.

my point about this is that mongo have provided too much functions to support all DB requirement.and lose its core design brief.this cause messes when using mongo db.it want to provide RDBMS function,also provide high availbility,scale out.

today mongo provide replica set deployment to meet normal data storage.and sharding cluster for large data storage.it is easy to convert replica set architect to sharding cluster deployment.but from application side,it is not easy to keep same query operation efficiency.

and other things like Data engine.mongo provide MMap,WireTiger,also other third party data engine.which also cause application developer to optimize the performance.

MongoDB doesn't do master-master replication.

2) MongoDB - Multiple cluster DR

As per Ron Galbraith BMC documentation MongoDB configuration across 2 sites - and manual DR option the issue arises around forming a Majority to elect a new Primary server (based on information on the MongoDB Strategy around fault tolerance.

3)MongoDB - Multiple cluster Blue-green deployment

blue-green deployment strategy is Zero downtime during application deployment is one of the key requirements for continuos delivery. And no business would like their site to be down and showing maintenance page every few days/weeks during deployment.

To achieve this we decide to go for blue-green deployment. However, we were challenged with how to do this in legacy style data center infrastructure where we are,

Not able to spin new and throw away machines automatically using scripts Don’t have ability to add/remove instances using scripts from load-balancer Network level configurations are done manually like firewall setting

As per Sunit Parekh blog documentation of Decision 1 MongoDB database didn’t require any schema migration etc. However, we required to follow design principle, always write code which is backward compatible with the data models. And if there is any database migration required it should be run after deployment.

0

Build your cluster nodes as replica sets, one node per data centre, add arbiter to the third location (arbiter don't need any extra resources, it's just "observer" who vote when needed). Use node priority (>1) to keep primary at first DC.

2
  • Yes we are using cluster node as replica set. But actually we need to sync data between 2 different clusters. That means we have 2 separate clusters placed in two different region. Say as cluster1 and cluster2. We need to sync cluster1 data in real time with cluster2 something similar to Mysql Master-Master replication. May 16, 2018 at 11:31
  • Master-Master replication don't exists at mongo world, sadly! But one way replication can be done (not two way; not with same DBs) with github.com/mongodb-labs/mongo-connector
    – JJussi
    May 16, 2018 at 17:34

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.