From a3f5a9ab905f01228f9b429ada8eb283a2387642 Mon Sep 17 00:00:00 2001 From: kay Date: Wed, 20 Feb 2013 12:39:52 -0500 Subject: [PATCH] DOCS-387 FAQ entry for shard balancer prioritization DOCS-387 incorporate Jeremy's comments DOCS-387 balancer and shard drain --- source/faq/sharding.txt | 42 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 42 insertions(+) diff --git a/source/faq/sharding.txt b/source/faq/sharding.txt index c1ccb64fde3..42579fd362b 100644 --- a/source/faq/sharding.txt +++ b/source/faq/sharding.txt @@ -399,3 +399,45 @@ chunk migration failure independently. If you encounter this issue, contact the `MongoDB User Group `_ or 10gen support to address this issue. + +How does draining a shard affect the balancing of uneven chunk distribution? +---------------------------------------------------------------------------- + +Consider the scenario where you have a sharded cluster with an uneven +chunk distribution and you remove a shard as well as add new shards. + +With version 2.2, the balancer first removes the chunks from the +draining shard and then balances the uneven chunk distribution. + +Before version 2.2, the balancer first handles the uneven chunk +distribution and then removes the chunks from the draining shard. +Although this balancer prioritization is **not** configurable, you can, +however, achieve the desired behavior with one of the following manual +solutions: + +- Option 1 + + #. Stop the balancer. + + #. Use the :dbcommand:`moveChunk` command to move chunks off of the + draining shard. + + #. Restart the balancer. + +- Option 2 + + #. Set the ``maxSize`` on the new shards to some low value so that they + cannot accept more chunks. This should stop the balancing + operation and allow the draining to continue with chunks + moved to the full shards. + + #. Restore the original ``maxSize`` on the new shards. + + .. note:: + + When changing the ``maxSize`` in the :term:`config database`: + + - in versions 2.0+, run the :dbcommand:`flushRouterConfig` command + to refresh the :program:`mongos`. + + - in versions pre-2.0, you need to restart :program:`mongos`.