Skip to content

Commit 8d36d29

Browse files
kennethdyerDave Cuthbert
andauthored
DOCSP-22863 Configuration (#41)
* DOCSP-22863 Configuration page * DOCSP-22863 Configuration page * DOCSP-22863 Configuration page * DOCSP-22863 Configuration page * DOCSP-22863 Configuration page * DOCSP-22863 Configuration page * DOCSP-22863 Configuration page * DOCSP-22863 Configuration page * DOCSP-22863 Configuration Setting/Option Map * DOCSP-22863 Configuration Setting/Option Map * DOCSP-22863 Configuration introduction * DOCSP-22863 Test cluster0 include * DOCSP-22863 Include updates * DOCSP-22863 Spelling * DOCSP-22863 Typo * DOCSP-22863 header content * DOCSP-22863 Alphabetizes CLI options * DOCSP-22863 Reorders TOC * DOCSP-22863 Fixes per Alan Zheng * DOCSP-22863 Fixes per Ian Fogelman * DOCSP-22863 Fixes per Ian Fogelman * DOCSP-22863 Fixes per Alan Zheng * DOCSP-22863 Fixes build error * DOCSP-22863 Fixes build error * DOCSP-22863 Fixes build error * DOCSP-22863 Fixes build error * DOCSP-23350 write-blocking note (#52) * DOCSP-23350 write-blokcing note * staging updates * Review feedback * Review feedback * Review feedback * Review feedback * Review feedback * DOCSP-23337 users and roles not synched (#55) * DOCSP-23337 users and roles not synched * Review feedback * Review feedback * DOCS-15427 System Collection Limitations (#59) * DOCS-15427 Adds System Collection limitation * DOCS-15427 Adds System Collection limitation * DOCS-15427 Fixes per Joe * DOCS-15427 Fixes per Joe * Merge with upstream master * Merge with upstream master * Merge with upstream master * Merge with upstream master * DOCSP-22863 Alphabetizes CLI options * DOCSP-22863 Build errors * DOCSP-22863 Build errors * DOCSP-22863 Build errors * DOCSP-22863 Fixes per Tim Fogarty * DOCSP-22863 Increases depth on mongosync * DOCSP-22863 Fixes per Tim Fogarty * DOCSP-22863 Fixes build error Co-authored-by: Dave Cuthbert <[email protected]>
1 parent eb4bd2e commit 8d36d29

File tree

9 files changed

+208
-47
lines changed

9 files changed

+208
-47
lines changed

source/includes/opts/cluster0.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. reference/configuration.txt
2+
.. reference/mongosync.txt
3+
4+
Sets the :ref:`connection URI <mongodb-uri>` for the first cluster.
5+
The first cluster can serve as either the source or the destination
6+
in the sync process. Designate the source and destination clusters
7+
in the call to the :ref:`c2c-api-start` API endpoint.
8+
9+
For more information on connecting ``mongosync``, see
10+
:ref:`Connections <c2c-connecting>`.

source/includes/opts/cluster1.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. reference/configuration.txt
2+
.. reference/mongosync.txt
3+
4+
Sets the :ref:`connection URI <mongodb-uri>` for the second cluster.
5+
The second cluster can serve as either the source or the destination
6+
in the sync process. Designate the source and destination clusters
7+
in the call to the :ref:`c2c-api-start` API endpoint.
8+
9+
For more information on connecting ``mongosync``, see
10+
:ref:`Connections <c2c-connecting>`.

source/includes/opts/id.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
.. reference/configuration.txt
2+
.. reference/mongosync.txt
3+
4+
Sets an identifier for the ``mongosync`` instance.
5+
6+
Use this |opt-term| when running multiple instances of ``mongosync`` on a sharded
7+
cluster, to synchronize the shards individually.
8+
9+
The identifier value for this |opt-term| must correspond to the shard ID of the
10+
shard it syncs. To find the shard ID, use the :dbcommand:`listShards` command.

source/includes/opts/logPath.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
.. reference/configuration.txt
2+
.. reference/mongosync.txt
3+
4+
Sets the path to the log directory. {+c2c-product-name+} writes logs
5+
to files in this directory.

source/includes/opts/port.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
.. reference/configuration.txt
2+
.. reference/mongosync.txt
3+
4+
*Default*: ``27182``
5+
6+
Sets the port used by the HTTP server for the {+c2c-product-name+}
7+
HTTP API.

source/includes/opts/verbosity.rst

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
.. reference/configuration.txt
2+
.. reference/mongosync.txt
3+
4+
*Default*: ``INFO``
5+
6+
Sets the verbosity level to use in log messages.
7+
{+c2c-product-name+} logs all messages at the specified level and
8+
any messages at lower levels.
9+
10+
The |verbosity-opt| |verbosity-opt-type| supports the following values:
11+
12+
- ``TRACE``
13+
- ``DEBUG``
14+
- ``INFO``
15+
- ``WARN``
16+
- ``ERROR``
17+
- ``FATAL``
18+
- ``PANIC``

source/reference.txt

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,9 @@ Reference
88
:titlesonly:
99

1010
/reference/mongosync
11+
/reference/configuration
1112
/reference/api
1213
/reference/mongosync-states
14+
/reference/configuration
1315
/reference/limitations
1416

source/reference/configuration.txt

Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
.. _c2c-config:
2+
3+
Configuration
4+
#############
5+
6+
.. include:: /includes/preview-warning
7+
8+
.. default-domain:: mongodb
9+
10+
.. contents:: On this page
11+
:local:
12+
:backlinks: none
13+
:depth: 2
14+
:class: singlecol
15+
16+
You can configure :program:`mongosync` instances at startup using a configuration
17+
file. The configuration file contains settings that are the equivalent of
18+
``mongosync`` command-line options.
19+
20+
21+
Configuration File
22+
==================
23+
24+
Most :program:`mongosync` command-line options can be written to file.
25+
The configuration file specifies values for each setting using YAML format.
26+
For example:
27+
28+
.. code-block:: yaml
29+
30+
cluster0: "mongodb://192.0.2.10:27017"
31+
cluster1: "mongodb://192.0.2.20:27017"
32+
logPath: "/var/log/mongosync"
33+
verbosity: "WARN"
34+
35+
To use a configuration file, start ``mongosync`` with the :option:`--config`
36+
option to set the path to the file:
37+
38+
.. code-block:: console
39+
40+
$ mongosync --config mongosync.conf
41+
42+
Options
43+
=======
44+
45+
.. |opt-term| replace:: setting
46+
47+
.. setting:: cluster0
48+
49+
*Type*: string
50+
51+
.. include:: /includes/opts/cluster0.rst
52+
53+
To set the ``cluster0`` setting from the command-line,
54+
see the :option:`--cluster0` option.
55+
56+
57+
.. setting:: cluster1
58+
59+
*Type*: string
60+
61+
.. include:: /includes/opts/cluster1.rst
62+
63+
To set the ``cluster1`` setting from the command-line,
64+
see the :option:`--cluster1` option.
65+
66+
.. setting:: id
67+
68+
*Type*: string
69+
70+
.. include:: /includes/opts/id.rst
71+
72+
To set the ``id`` setting from the command-line,
73+
see the :option:`--id` option.
74+
75+
.. setting:: logPath
76+
77+
*Type*: string
78+
79+
.. include:: /includes/opts/logPath.rst
80+
81+
To set the ``logPath`` setting from the command-line,
82+
see the :option:`--logPath` option.
83+
84+
.. setting:: port
85+
86+
*Type*: integer
87+
88+
.. include:: /includes/opts/port.rst
89+
90+
To set the ``port`` setting from the command-line,
91+
see the :option:`--port` option.
92+
93+
94+
.. setting:: verbosity
95+
96+
*Type*: string
97+
98+
.. |verbosity-opt-type| replace:: setting
99+
.. |verbosity-opt| replace:: ``verbosity``
100+
101+
.. include:: /includes/opts/verbosity.rst
102+
103+
To set the ``verbosity`` setting from the command-line,
104+
see the :option:`--verbosity` option.
105+

source/reference/mongosync.txt

Lines changed: 41 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
.. contents:: On this page
1414
:local:
1515
:backlinks: none
16-
:depth: 1
16+
:depth: 2
1717
:class: singlecol
1818

1919
Description
@@ -35,83 +35,77 @@ line options.
3535
standalone instance <server-replica-set-deploy-convert>` to a
3636
replica set before using {+c2c-product-name+}.
3737

38+
.. _c2c-cli-options:
39+
3840
Options
3941
-------
4042

43+
.. |opt-term| replace:: option
44+
4145
Global Options
4246
~~~~~~~~~~~~~~
4347

4448
.. option:: --cluster0 <URI>
4549

46-
Sets the :ref:`connection URI <mongodb-uri>` for the first cluster.
47-
The first cluster can serve as either the source or the destination
48-
in the sync process. Designate the source and destination clusters
49-
in the call to the :ref:`c2c-api-start` API endpoint.
50+
.. include:: /includes/opts/cluster0.rst
51+
52+
To set the ``--cluster0`` option from a configuration file,
53+
see the :setting:`cluster0` setting.
5054

51-
For more information on connecting ``mongosync``, see
52-
:ref:`Connections <c2c-connecting>`.
5355

5456
.. option:: --cluster1 <URI>
5557

56-
Sets the :ref:`connection URI <mongodb-uri>` for the second cluster.
57-
The second cluster can serve as either the source or the destination
58-
in the sync process. Designate the source and destination clusters
59-
in the call to the :ref:`c2c-api-start` API endpoint.
58+
.. include:: /includes/opts/cluster0.rst
59+
60+
To set the ``--cluster1`` option from a configuration file,
61+
see the :setting:`cluster1` setting.
6062

61-
For more information on connecting ``mongosync``, see
62-
:ref:`Connections <c2c-connecting>`.
6363

6464
.. option:: --config <filename>
6565

6666
Sets the path to the configuration file.
6767

6868
For more information, see :ref:`c2c-mongosync-config`.
6969

70-
.. option:: --help, h
70+
71+
.. option:: --help, -h
7172

7273
Prints usage information to stdout.
7374

75+
7476
.. option:: --id <ID>
7577

76-
Sets an identifier for the ``mongosync`` instance.
78+
.. include:: /includes/opts/id.rst
7779

78-
Use this option when running multiple instances of ``mongosync`` on
79-
a sharded cluster, to synchronize the shards individually.
80-
81-
The ``--id`` option must correspond to the shard ID of the shard it
82-
syncs. To find the shard ID, use the :dbcommand:`listShards`
83-
command.
80+
To set the ``--id`` option from a configuration file,
81+
see the :setting:`id` setting.
8482

8583
.. option:: --logPath <DIR>
8684

87-
Sets the path to the log directory. {+c2c-product-name+} writes logs
88-
to files in this directory.
85+
.. include:: /includes/opts/logPath.rst
86+
87+
To set the ``--logPath`` option from a configuration file,
88+
see the :setting:`logPath` setting.
8989

9090
.. option:: --port
9191

92-
*Default*: ``27182``
92+
.. include:: /includes/opts/port.rst
9393

94-
Sets the port used by the HTTP server for the {+c2c-product-name+}
95-
HTTP API.
9694

97-
.. option:: --verbosity <level>
95+
To set the ``--port`` option from a configuration file,
96+
see the :setting:`port` setting.
9897

99-
*Default*: ``INFO``
10098

101-
Sets the verbosity level to use in log messages.
102-
{+c2c-product-name+} logs all messages at the specified level and
103-
any messages at lower levels.
99+
.. option:: --verbosity <level>
104100

105-
The ``--verbosity`` option supports the following values:
101+
.. |verbosity-opt-type| replace:: option
102+
.. |verbosity-opt| replace:: ``--verbosity``
106103

107-
- ``TRACE``
108-
- ``DEBUG``
109-
- ``INFO``
110-
- ``WARN``
111-
- ``ERROR``
112-
- ``FATAL``
113-
- ``PANIC``
104+
.. include:: /includes/opts/verbosity.rst
114105

106+
To set the ``--verbosity`` option from a configuration file,
107+
see the :setting:`verbosity` setting.
108+
115109
.. option:: --version, -v
116110

117111
Prints ``mongosync`` version information to stdout.
@@ -133,14 +127,14 @@ Configuration File
133127
~~~~~~~~~~~~~~~~~~
134128

135129
Options for ``mongosync`` can be set in a YAML configuration file. Use
136-
the :option:`--config` option. To specify the path to the configuration
137-
file. For example:
130+
the :option:`--config` option. For example:
131+
132+
.. code-block:: console
133+
134+
$ mongosync --config /etc/mongosync.conf
138135

139-
.. code-block:: yaml
136+
For information on available settings, see :ref:`Configuration <c2c-config>`.
140137

141-
# Cluster Configuration
142-
cluster0: "mongodb://192.0.2.10:27017,192.0.2.11:27017,192.0.2.12:27017"
143-
cluster1: "mongodb://192.0.2.20:27017,192.0.2.21:27017,192.0.2.22:27017"
144138

145139
Consistency
146140
~~~~~~~~~~~
@@ -149,14 +143,14 @@ Consistency
149143
cluster. Read Consistency is not guaranteed on the destination cluster,
150144
the source and destination clusters may differ at a given point in
151145
time. However, if new writes are halted on the source cluster, the
152-
source and destination clusters will eventually hold the same data.
146+
source and destination clusters will eventually hold the same data.
153147

154148
Individual writes may be reordered or combined as they are relayed from
155149
source to destination. For a given document, the total number of writes
156150
may differ between source and destination.
157151

158152
Transactions may appear non-atomically on the destination cluster.
159-
Retryable writes may not be retryable on the destination cluster.
153+
Retryable writes may not be retryable on the destination cluster.
160154

161155
Profiling
162156
~~~~~~~~~

0 commit comments

Comments
 (0)