Skip to content

Commit c7c2104

Browse files
Merge remote-tracking branch 'refs/remotes/upstream/master' into DOCSP-22726-c2c-install-v2
2 parents 86006ca + 2fd95fb commit c7c2104

File tree

2 files changed

+238
-2
lines changed

2 files changed

+238
-2
lines changed

source/faq.txt

Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,3 +10,82 @@ Frequently Asked Questions
1010
This page provides answers to some frequently asked questions we have
1111
encountered. If you have additional questions please contact MongoDB
1212
Support.
13+
14+
Does ``mongosync`` have to use the same operating system as MongoDB Enterprise Server?
15+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
16+
17+
When ``mongosync`` runs on its own hardware, it does not have to use
18+
the same operation system (OS) as the source or destination clusters it
19+
is connecting.
20+
21+
Should I increase the size of the oplog in the source cluster?
22+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
23+
24+
If you anticipate synchronizing a large data set, or if you plan to
25+
pause synchronization for an extended period of time, increase the size
26+
of the replica set :term:`oplog` in the source cluster.
27+
28+
The ``oplog`` in the source cluster must be large enough to track
29+
events that happen during the time it takes to complete the initial
30+
sync to the destination cluster.
31+
32+
The proper ``oplog`` size depends on system hardware, network speed,
33+
and other factors including system workload. However, assuming network
34+
transfer speeds of 30-50GB per hour, a rough formula to estimate the
35+
required ``oplog`` size is:
36+
37+
.. code-block:: shell
38+
39+
minimumRetentionHours = dataSizeInGB / 30
40+
41+
To learn more about how to increase the size of the ``oplog``, see:
42+
:ref:`tutorial-change-oplog-size`.
43+
44+
Which connection string options does ``mongosync`` allow?
45+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46+
47+
``mongosync`` requires :ref:`readConcern: "majority" <read-concern>`
48+
and :ref:`writeConcern: "majority" <write-concern>`. ``mongosync``
49+
overwrites any other ``readConcern`` or ``writeConcern`` and uses
50+
``"majority"`` instead.
51+
52+
``monogosync`` accepts all other :ref:`connection string options
53+
<mongodb-uri>`.
54+
55+
56+
Which security and authentication options are supported?
57+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
58+
59+
``mongosync`` uses a standard MongoDB :ref:`connection string
60+
<mongodb-uri>` to connect to the source and destination clusters.
61+
62+
:ref:`LDAP <security-auth-ldap>` and :ref:`X509
63+
<authentication-mechanism-x509>` are supported. For available
64+
authentication options, see :ref:`authentication`.
65+
66+
67+
Can I configure ``mongosync`` for high availability?
68+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69+
70+
There is no automatic failover built into ``mongosync``. However you
71+
can write a script or use your operating system's process managers,
72+
``systemd`` for example, to restart the ``mongosync`` process.
73+
74+
The ``mongosync`` binary is stateless. The metadata for restarting is
75+
stored on the destination cluster.
76+
77+
A ``mongosync`` operation can be resumed if ``mongosync`` becomes
78+
unavailable during synchronization. When ``mongosync`` becomes
79+
available again, restart the ``mongosync`` process with the same
80+
parameters. ``mongosync`` resumes the operation from where it stopped
81+
when ``mongosync`` became unavailable.
82+
83+
Can the source or destination be a replica set with arbiters?
84+
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
85+
86+
Yes, the replica set can have arbiters. The source replica set must
87+
have more than 2 non-arbiter nodes and you must sync from a non-arbiter
88+
node. Use the source cluster's connection string to specify a
89+
:ref:`read preference <mongodb-uri>` for a non-arbiter, data-bearing
90+
node.
91+

source/reference/mongosync.txt

Lines changed: 159 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,166 @@
11
.. _c2c-mongosync:
22

3+
.. default-domain:: mongodb
4+
5+
.. program:: mongosync
6+
37
=============
48
``mongosync``
59
=============
610

7-
.. default-domain:: mongodb
11+
.. contents:: On this page
12+
:local:
13+
:backlinks: none
14+
:depth: 1
15+
:class: singlecol
16+
17+
Description
18+
-----------
19+
20+
The ``mongosync`` binary is the primary process used in Cluster-to-Cluster Sync.
21+
It migrates data from one cluster to another and can keep the clusters
22+
in continuous sync.
23+
24+
This document provides a complete overview of all command-line options.
25+
26+
Options
27+
-------
28+
29+
Global Options
30+
~~~~~~~~~~~~~~
31+
32+
.. option:: --cluster0 <URI>
33+
34+
Sets the :ref:`connection URI <mongodb-uri>` for the first cluster.
35+
The first cluster can serve as either the source cluster or the destination
36+
cluster in the sync process.
37+
38+
.. note::
39+
40+
The cluster must use MongoDB 6.0 or later.
41+
42+
43+
For more information on connecting ``mongosync``, see
44+
:ref:`Connections <c2c-conn-top-level>`.
45+
46+
47+
.. option:: --cluster1 <URI>
48+
49+
Sets the :ref:`connection URI <mongodb-uri>` for the second cluster.
50+
The second cluster can serve as either the source cluster or the destination
51+
cluster in the sync process.
52+
53+
.. note::
54+
55+
The cluster must use MongoDB 6.0 or later.
56+
57+
58+
For more information on connecting ``mongosync``, see
59+
:ref:`Connections <c2c-conn-top-level>`.
60+
61+
62+
.. option:: --verbosity <level>
63+
64+
*Default*: ``INFO``
65+
66+
Sets the verbosity level to use in log messages. Cluster-to-Cluster Sync logs
67+
all messages at the specified level as well as any messages at less severe levels.
68+
69+
The ``--verbosity`` option supports the following values:
70+
71+
- ``TRACE``
72+
- ``DEBUG``
73+
- ``INFO``
74+
- ``WARN``
75+
- ``ERROR``
76+
- ``FATAL``
77+
- ``PANIC``
78+
79+
80+
.. option:: --logPath <DIR>
81+
82+
Sets the path to the log directory. Cluster-to-Cluster Sync writes logs to
83+
files in this directory.
84+
85+
86+
.. option:: --port
87+
88+
*Default*: ``27182``
89+
90+
Sets the port used by the HTTP server for the Cluster-to-Cluster Sync REST API.
91+
92+
93+
.. option:: --id <ID>
94+
95+
Sets an identifier for the ``mongosync`` instance.
96+
97+
Use this option when running multiple instances of ``mongosync`` on a sharded
98+
cluster, to synchronize the shards individually. The ``--id`` option must
99+
correspond to the shard ID of the shard it
100+
syncs. To find the shard ID, use the :dbcommand:`listShards` command.
101+
102+
.. option:: --config <filename>
103+
104+
Sets the path to the configuration file.
105+
106+
For more information, see :ref:`c2c-mongosync-config`.
107+
108+
109+
.. option:: --version, -v
110+
111+
Prints ``mongosync`` version information to stdout.
112+
113+
114+
.. option:: --help, h
115+
116+
Prints usage information to stdout.
117+
118+
119+
Behavior
120+
--------
121+
122+
.. _c2c-mongosync-config:
123+
124+
Configuration File
125+
~~~~~~~~~~~~~~~~~~
126+
127+
Options for ``mongosync`` can be set in a YAML configuration file, specified
128+
using the :option:`--config` option. For example:
129+
130+
.. code-block:: yaml
131+
132+
# Cluster Configuration
133+
cluster0: "mongodb://192.0.2.10:27017,192.0.2.11:27017,192.0.2.12:27017"
134+
cluster1: "mongodb://192.0.2.20:27017,192.0.2.21:27017,192.0.2.22:27017"
135+
136+
137+
Examples
138+
--------
139+
140+
#. Deploy a source and a destination cluster.
141+
142+
#. Initialize Cluster-to-Cluster Sync:
143+
144+
.. code-block:: bash
145+
146+
mongosync \
147+
--cluster0 'mongodb://192.0.2.10:27017,192.0.2.11:27017,192.0.2.12:27017' \
148+
--cluster1 'mongodb://192.0.2.20:27017,192.0.2.21:27017,192.0.2.22:27017'
149+
150+
Use the appropriate connection strings for the :option:`--cluster0` and
151+
:option:`--cluster1` options so that they can connect to your replica sets.
152+
153+
#. To start the synchronization process, use a REST client such as cURL to send
154+
the ``start`` command to ``mongosync``:
155+
156+
.. code-block:: bash
157+
158+
curl localhost:27182/api/v1/start -X POST \
159+
--data '{ "source": "cluster0", "destination": "cluster1" }'
160+
161+
Example Output:
162+
163+
.. code-block:: json
164+
:copyable: false
8165

9-
Migrate data between clusters using ``mongosync``.
166+
{ "success": true }

0 commit comments

Comments
 (0)