Skip to content
This repository was archived by the owner on May 1, 2025. It is now read-only.

Commit a2ab127

Browse files
committed
feedback and restructure
1 parent f1d0a43 commit a2ab127

File tree

3 files changed

+82
-47
lines changed

3 files changed

+82
-47
lines changed

source/includes/fact-mongosync-balancer.rst

Lines changed: 16 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,21 @@
11
.. important::
22

3-
When the source or destination cluster is a sharded cluster, you must stop
4-
the source cluster's balancer on collections within the :ref:`namespace
5-
filter <c2c-filtered-sync>`. You can enable the source cluster's balancer on
6-
the cluster level and for collections outside the namespace filter.
7-
You must also stop the destination cluster's balancer.
3+
If the source or destination cluster is a sharded cluster
4+
and you are not running ``mongosync`` with namespace filtering,
5+
you must disable the source cluster's balancer
6+
by running the :dbcommand:`balancerStop` command and waiting 15 minutes
7+
for the command to complete.
8+
9+
If the source or destination cluster is a sharded cluster and you
10+
are running ``mongosync`` with :ref:`namespace
11+
filtering <c2c-filtered-sync>`, you can enable the source cluster's
12+
balancer overall but you must disable it for
13+
all collections within the namespace filter.
14+
See :ref:`disabling-balancer-filtered`. You can also disable
15+
the source cluster's balancer.
16+
17+
You must always disable the balancer on a sharded destination
18+
cluster.
819

920
During migration, do not run the :dbcommand:`moveChunk` or
1021
:dbcommand:`moveRange` commands. If you have enabled the source cluster's

source/reference/limitations.txt

Lines changed: 16 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -124,15 +124,22 @@ Sharded Clusters
124124
To check for index inconsistencies, see :ref:`Find Inconsistent
125125
Indexes Across Shards <manage-indexes-find-inconsistent-indexes>`.
126126

127-
- When the source or destination cluster is a sharded cluster, you must stop
128-
the source cluster's balancer on collections within the :ref:`namespace
129-
filter <c2c-filtered-sync>`. You can enable the source cluster's balancer on
130-
the cluster level and for collections outside the namespace filter.
131-
If you are not running a filtered sync, you must stop the source cluster's
132-
balancer.
133-
You must also stop the destination cluster's balancer. See
134-
:ref:`enabling-balancer-filtered` to learn how to enable the balancer during
135-
filtered sync.
127+
- If the source or destination cluster is a sharded cluster
128+
and you are not running ``mongosync`` with namespace filtering,
129+
you must disable the source cluster's balancer
130+
by running the :dbcommand:`balancerStop` command and waiting 15 minutes
131+
for the command to complete.
132+
133+
If the source or destination cluster is a sharded cluster and you
134+
are running ``mongosync`` with :ref:`namespace
135+
filtering <c2c-filtered-sync>`, you can enable the source cluster's
136+
balancer overall but you must disable it for
137+
all collections within the namespace filter.
138+
See :ref:`disabling-balancer-filtered`. You can also disable
139+
the source cluster's balancer.
140+
141+
You must always disable the balancer on a sharded destination
142+
cluster.
136143

137144
- If you have enabled the source cluster's
138145
balancer, but disabled it for collections within the namespace

source/reference/mongosync/mongosync-behavior.txt

Lines changed: 50 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -102,39 +102,56 @@ preserve the source cluster's sharding configuration.
102102

103103
.. include:: /includes/fact-mongosync-balancer.rst
104104

105-
.. _enabling-balancer-filtered:
106-
107-
Enabling Balancer in Filtered Sync
108-
''''''''''''''''''''''''''''''''''
109-
110-
Before starting ``mongosync`` with a :ref:`namespace filter
111-
<c2c-filtered-sync>`, enable the balancer for the source cluster
112-
by running the :method:`sh.startBalancer()` method in ``mongosh``.
113-
Then, disable the balancer for each collection within the
114-
namespace filter by running the :dbcommand:`setAllowMigrations` command:
115-
116-
.. code-block:: shell
117-
118-
db.adminCommand(
119-
{
120-
setAllowMigrations: “<db>.<collection>”,
121-
allowMigrations: false
122-
}
123-
)
124-
125-
Run the preceding command for every collection within the
126-
namespace filter.
127-
128-
Then, run the :dbcommand:`balancerStop` command to stop
129-
the balancer on the destination cluster and wait for the command to complete.
130-
131-
After stopping the balancer, wait fifteen minutes before
132-
starting ``mongosync``. This gives the cluster time to
133-
finish any in progress chunk migrations.
134-
135-
If you enable the source cluster's balancer but do not use a
136-
namespace filter, or if you disable the balancer for all
137-
collections within the namespace filter, ``mongosync`` fails.
105+
.. _disabling-balancer-filtered:
106+
107+
Disabling Balancer for Collections in Filtered Sync
108+
'''''''''''''''''''''''''''''''''''''''''''''''''''
109+
110+
If you want to enable the balancer for collections that are not
111+
included in the namespace filter, use the following instructions before
112+
starting ``mongosync``. These instructions allow you to enable the balancer
113+
for the source cluster and disable the balancer for collections
114+
within the namespace filter.
115+
116+
.. procedure::
117+
118+
.. step:: Enable the balancer for the source cluster.
119+
120+
Before starting ``mongosync`` with a :ref:`namespace filter
121+
<c2c-filtered-sync>`, enable the balancer for the source cluster
122+
by running the :method:`sh.startBalancer()` method in ``mongosh``.
123+
124+
.. step:: Disable the balancer for each collection.
125+
126+
Disable the balancer for each collection within the
127+
namespace filter by running the :dbcommand:`setAllowMigrations` command:
128+
129+
.. code-block:: shell
130+
131+
db.adminCommand(
132+
{
133+
setAllowMigrations: “<db>.<collection>”,
134+
allowMigrations: false
135+
}
136+
)
137+
138+
Run the preceding command for every collection within the
139+
namespace filter.
140+
141+
.. step:: Stop the balancer on the destination cluster.
142+
143+
Run the :dbcommand:`balancerStop` command to stop
144+
the balancer on the destination cluster and wait
145+
for the command to complete.
146+
After stopping the balancer, wait **fifteen minutes** before
147+
starting ``mongosync``. This gives the cluster time to
148+
finish any in progress chunk migrations.
149+
150+
.. important::
151+
152+
If you enable the source cluster's balancer but do not use a
153+
namespace filter, or if you do not disable the balancer for all
154+
collections within the namespace filter, ``mongosync`` fails.
138155

139156
Pre-Split Chunks
140157
''''''''''''''''

0 commit comments

Comments
 (0)