@@ -548,7 +548,17 @@ However, you may want to migrate chunks manually in a few cases:
548
548
- If the balancer in an active cluster cannot distribute chunks within
549
549
the balancing window, then you will have to migrate chunks manually.
550
550
551
- To migrate chunks, use the :dbcommand:`moveChunk` command.
551
+ To migrate chunks, use the :dbcommand:`moveChunk` command.
552
+
553
+ .. note::
554
+
555
+ To return a list of shards, use the :dbcommand:`listshards`
556
+ command.
557
+
558
+ Specify shard names using the :dbcommand:`addShard` command
559
+ using the ``name`` argument. If you do not specify a name in the
560
+ :dbcommand:`addShard` command, MongoDB will assign a name
561
+ automatically.
552
562
553
563
The following example assumes that the field ``username`` is the
554
564
:term:`shard key` for a collection named ``users`` in the ``myapp``
@@ -572,15 +582,17 @@ block until the migration is complete.
572
582
:term:`secondary` members have replicated operations before allowing
573
583
new chunk migrations.
574
584
575
- .. note ::
585
+ .. warning ::
576
586
577
- To return a list of shards, use the :dbcommand:`listshards`
578
- command.
587
+ The :dbcommand:`moveChunk` command may produce an error message:
579
588
580
- Specify shard names using the :dbcommand:`addShard` command
581
- using the ``name`` argument. If you do not specify a name in the
582
- :dbcommand:`addShard` command, MongoDB will assign a name
583
- automatically.
589
+ .. code-block:: none
590
+
591
+ The collection's metadata lock is already taken.
592
+
593
+ when there are open :term:`cursors <cursor>` accessing the chunk to
594
+ be moved. To fix this situation, either wait until the cursors
595
+ complete their operation or remove the cursors.
584
596
585
597
.. index:: balancing; operations
586
598
.. _sharding-balancing-operations:
0 commit comments