Skip to content

DOCS-387 FAQ entry for shard balancer prioritization #669

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 21, 2013
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
42 changes: 42 additions & 0 deletions source/faq/sharding.txt
Original file line number Diff line number Diff line change
Expand Up @@ -399,3 +399,45 @@ chunk migration failure independently.
If you encounter this issue, contact the `MongoDB User Group
<http://groups.google.com/group/mongodb-user>`_ 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`.