0

I have one case where i create db for Daily data. I have some collections in this db which are sharded. My requirement is as follows: Create every day DB If There is a DB which is more than 7 days old take its dump in some location and delete it from live DB.

I have one question how can i check if chunk transfer/balancing was completed for this DB before taking its dump and deleting it. I am concern if i delete the DB whose chinks were not transferred completed will it corrupt my system

Regards Virendra Agarwal

1 Answer 1

1

To ensure there are no migrations in progress while taking your backup, you should stop the balancer via sh.stopBalancer(). Any in-progress migrations will be completed before the balancer is disabled.

If you want to ensure the balancer is stopped before taking your backup, you can run the following in the mongo shell, which should return true:

 !sh.getBalancerState() && !sh.isBalancerRunning()

After taking your backup, you need to remember to start the balancer again.

1
  • Thats a great answer
    – viren
    Commented Aug 25, 2014 at 9:33

Your Answer

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

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