On Saturday, 6 February 2016 01:34:21 UTC+11, Jorn Jambers wrote:
I'm unable to backup a sharded mongodb cluster
/mongo-metadata/backuptest# mongodump --directoryperdb --oplog --out dump --host 10.100.x.x --port 27017
connected to: 10.100.x.x:27017
assertion: 13106 nextSafe(): { $err: "can't use 'local' database through mongos", code: 13644 }
Apparently you cannot do a dump with --oplog when using a sharded collections. But how do you do consistent backups then, without locking everything?
Hi Jorn,
Please see the MongoDB manual for supported procedures to
Backup and Restore Sharded Clusters. Some coordination is required to take a consistent backup of a sharded cluster as there are a number of moving parts (sharded cluster balancer, sharded cluster metadata, and individual shards).
For production backups, common approaches include using coordinated filesystem snapshots or a service like
MongoDB Cloud Manager. Generally
mongodump is not recommendable as a backup strategy for larger databases as it incurs more overhead/time for both backups (paging through all data will affect your working set) and restores (data is backed up but indexes will need to be rebuilt).
Regards,
Stephen