1

We have a MongoDB community sharding cluster (4.2-prod env) that has 1 mongos, 1 conf ( 3 nodes as a replica set), and 2 shards( each of them has 3 nodes as a replicaset). We want to install stage env for prod env. We’ll also install the same arch in stage env, but we are searching for a solution about how we can feed stage env from prod env.

Is there architecture and a solution for the sharding cluster stage env that takes into account data synchronization for best practice? There could also be a bash method that doesn’t affect prod environments much.

Is there any recommendation?

Note : MongoDB doc says using mongodump and mongorestore are not good way and they say we must continue on enterprise ed. bc there are some methods that we can use for MongoDB 4.2 version :

"mongodump and mongorestore cannot be part of a backup strategy for 4.2+ sharded clusters that have sharded transactions in progress, as backups created with mongodump do not maintain the atomicity guarantees of transactions across shards."

Regards..

Serhat
  • 21
  • 3
  • Use `mongodump` and `mongorestore`, see https://stackoverflow.com/questions/11554762/how-to-copy-a-collection-from-one-database-to-another-in-mongodb/67077465#67077465 If you like to copy only part of production data, use `mongoexport` and `mongoimport`, see [--query](https://www.mongodb.com/docs/database-tools/mongoexport/#std-option-mongoexport.--query) – Wernfried Domscheit May 03 '22 at 14:54

0 Answers0