Migrating a MongoDB Cluster from one D.C to another with least Disruption

48 views
Skip to first unread message

Traiano Welcome

unread,
Jul 2, 2015, 7:42:42 PM7/2/15
to mongod...@googlegroups.com
Hi List!

 I've inherited a large mongodb cluster located in one D.C, and need to migrate it to another.
 What is the best process for migrating the entire cluster, with minimal or no downtime given the facts:

 - All (a single) replica sets are in the single D.C
 - about 3 TiB of data in 3 mongodb VM nodes (primary + 2 secondary)

There is a high speed fibre connection between the datacenters, nevertheless shutting down the nodes and copying them across would take some time.

I've been thinking that it might be possible to "stretch" the mongodb cluster across datacenters through replication, mirroring the replica set in the destination D.C, and perform some kind of cutover of the old primary to a new primary in the second d.c after  the two sets ar synched, however I'm not about the mechanics of this.

What are the options in this type of scenario?

Many thanks in advance,
Traiano

sallgeud

unread,
Jul 2, 2015, 10:42:29 PM7/2/15
to mongod...@googlegroups.com
  1. Add the new server to the replicaset (through rs.config())
  2. Once it's entirely sync'd and in SECONDARY mode, change your config to give it the highest priority (more rs.config())
  3. Shut down the old server(s)
Somewhere in there you could move one server at a time form the old DC to the new one, or just bring up 3 new replicaset members in the new DC and once they're up, set them higher priority and then remove the other 3 from config.
Reply all
Reply to author
Forward
0 new messages