|
| 1 | +Gather Connection Information |
| 2 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 3 | + |
| 4 | +The source cluster, ``cluster0``, is hosted on the following servers |
| 5 | +and ports: |
| 6 | + |
| 7 | +- clusterOne01.fancyCorp.com:20020 |
| 8 | +- clusterOne02.fancyCorp.com:20020 |
| 9 | +- clusterOne03.fancyCorp.com:20020 |
| 10 | + |
| 11 | +The destination cluster, ``cluster1``, is hosted on the following |
| 12 | +servers and ports: |
| 13 | + |
| 14 | +- clusterTwo-shard-00-00.abc12.mongodb.net:27017 |
| 15 | +- clusterTwo-shard-00-01.abc12.mongodb.net:27017 |
| 16 | +- clusterTwo-shard-00-02.abc12.mongodb.net:27017 |
| 17 | + |
| 18 | +There is an administrative user, ``clusterAdmin`` configured on each |
| 19 | +cluster with password, ``superSecret``. |
| 20 | + |
| 21 | +Connect the Source and Destination Clusters with ``mongosync`` |
| 22 | +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
| 23 | + |
| 24 | +Use the connection information you gathered to create the connection |
| 25 | +strings for ``cluster0`` and ``cluster1``: |
| 26 | + |
| 27 | +.. code-block:: shell |
| 28 | +
|
| 29 | + cluster0: |
| 30 | + mongodb://clusterAdmin:[email protected]:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020 |
| 31 | + cluster1: |
| 32 | + mongodb+srv://clusterAdmin:[email protected] |
| 33 | +
|
| 34 | +.. note:: |
| 35 | + |
| 36 | + Atlas clusters require TLS connections. To use ``mongosync`` with Atlas |
| 37 | + clusters, add the :urioption:`tls=true <tls>` option or use the |
| 38 | + ``mongodb+srv`` connection string format. For more details about |
| 39 | + ``mongodb+srv`` connection strings, see :ref:`connections-dns-seedlist`. |
| 40 | + |
| 41 | +The ``mongosync`` command layout below is modified for display. To |
| 42 | +connect ``cluster0`` to ``cluster1`` with ``mongosync``, enter the |
| 43 | +following command on one line: |
| 44 | + |
| 45 | +.. code-block:: shell |
| 46 | +
|
| 47 | + mongosync \ |
| 48 | + --cluster0 "mongodb://clusterAdmin:[email protected]:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020" \ |
| 49 | + --cluster1 "mongodb+srv://clusterAdmin:[email protected]" |
| 50 | +
|
0 commit comments