@@ -13,11 +13,17 @@ Configuration
1313 :class: singlecol
1414
1515You can configure :ref:`mongosync <c2c-mongosync>` instances at startup
16- using a configuration file. The configuration file contains settings that are
16+ by using :reF:`command line options <c2c-cli-options>` or a configuration file.
17+ The configuration file specifies values for settings that are
1718the equivalent of ``mongosync`` command line options.
1819
20+ During a migration, you can reconfigure certain ``mongosync`` settings by following the
21+ steps in :ref:`c2c-reconfigure-mid-migration`.
22+
23+ .. _c2c-configuration-file:
24+
1925Configuration File
20- ==================
26+ ------------------
2127
2228You can write most ``mongosync``
2329:ref:`command line options <c2c-cli-options>` to a YAML file. The
@@ -37,10 +43,14 @@ To use a configuration file, start ``mongosync`` with the
3743
3844.. code-block:: console
3945
40- $ mongosync --config mongosync.conf
46+ mongosync --config <configPath>
47+
48+ Settings
49+ ~~~~~~~~
50+
51+ You can configure the following ``mongosync`` settings using a configuration file.
4152
42- Options
43- =======
53+ To configure ``mongosync`` from the command line, see :ref:`c2c-cli-options`.
4454
4555.. note::
4656
@@ -144,3 +154,78 @@ Options
144154
145155 To set the ``verbosity`` setting from the command line, see the
146156 :option:`--verbosity` option.
157+
158+ .. _c2c-reconfigure-mid-migration:
159+
160+ Reconfigure ``mongosync`` During Synchronization
161+ ------------------------------------------------
162+
163+ .. important::
164+
165+ Only the following settings can be adjusted during a migration.
166+ Other settings **must** remain unchanged between ``mongosync`` restarts.
167+
168+ While ``mongosync`` is syncing, you can reconfigure the :option:`--config`, :option:`--disableTelemetry`,
169+ :option:`--loadLevel`, :option:`--logPath`, :option:`--port`, and :option:`--verbosity` options
170+ by performing the following steps:
171+
172+ .. procedure::
173+ :style: normal
174+
175+ .. step:: (Optional) Pause the ``mongosync`` processes
176+
177+ Run :ref:`c2c-api-pause` on each running ``mongosync`` process.
178+
179+ You can resume the ``mongosync`` processes later from the paused
180+ state, as shown in the final step.
181+
182+ .. tip::
183+
184+ If you don't want to immediately resume data synchronization
185+ operations after reconfiguration, consider pausing the
186+ ``mongosync`` processes. This is useful if you're coordinating
187+ operations from multiple ``mongosync`` processes.
188+
189+ .. step:: Stop the ``mongosync`` processes
190+
191+ Use your operating system to stop each running ``mongosync`` process.
192+ For the specific steps, see your operating system documentation.
193+
194+ .. step:: (Optional) Update your configuration file
195+
196+ If you used the :option:`--config` option to set the path to a configuration file
197+ when you first initialized ``mongosync``, update this configuration file with the new value for each setting.
198+
199+ .. step:: Initialize the ``mongosync`` processes
200+
201+ If you updated a configuration file in the last step, initialize
202+ the ``mongosync`` processes with the :option:`--config` option
203+ set to the path of the updated configuration file:
204+
205+ .. code-block:: console
206+
207+ mongosync --config <configPath>
208+
209+ If you did *not* use the :option:`--config` option when you first initialized ``mongosync``,
210+ initialize the ``mongosync`` processes with the command line options set to their updated values:
211+
212+ .. code-block:: console
213+
214+ mongosync \
215+ --cluster0 "<cluster0_connection_string>" \
216+ --cluster1 "<cluster1_connection_string>" \
217+ --loadLevel <newLevel>
218+
219+ For more information, see :ref:`Initialize mongosync <c2c-initialize>`.
220+
221+ .. step:: Start or Resume the ``mongosync`` processes
222+
223+ If you paused any ``mongosync`` processes earlier in the optional first step,
224+ run :ref:`c2c-api-resume` on the paused ``mongosync`` processes.
225+
226+ If you stopped any ``mongosync`` processes without using :ref:`c2c-api-pause`,
227+ run :ref:`c2c-api-start` on the stopped ``mongosync`` processes.
228+ For more detailed instructions, see :ref:`c2c-quickstart-synchronize`.
229+
230+ ``mongosync`` resumes the sync roughly where it was before you stopped the earlier proceses.
231+ Any partitions that were in progress at the time of termination will restart from the beginning.
0 commit comments