From 28b0e1d4818d1b88c418684c93a3653fe7554a65 Mon Sep 17 00:00:00 2001 From: Alison Huh <112565127+ajhuh-mdb@users.noreply.github.com> Date: Fri, 1 Mar 2024 11:08:46 -0800 Subject: [PATCH] DOCSP-23343 Improve Atlas Connection String Example (#272) * DOCSP-23343 Improve Atlas Connection String Example * text edits * move note * MT feedback * test * tiny changes * * * fix staging --- source/connecting/atlas-to-atlas.txt | 3 +- source/connecting/onprem-to-atlas.txt | 3 +- source/includes/example-connect-atlas.rst | 50 +++++++++++++++++++ .../includes/example-connect-onprem-atlas.rst | 50 +++++++++++++++++++ 4 files changed, 102 insertions(+), 4 deletions(-) create mode 100644 source/includes/example-connect-atlas.rst create mode 100644 source/includes/example-connect-onprem-atlas.rst diff --git a/source/connecting/atlas-to-atlas.txt b/source/connecting/atlas-to-atlas.txt index 44d711580..110a91f33 100644 --- a/source/connecting/atlas-to-atlas.txt +++ b/source/connecting/atlas-to-atlas.txt @@ -53,5 +53,4 @@ Limitations Example ------- -.. include:: /includes/example-connect - +.. include:: /includes/example-connect-atlas.rst diff --git a/source/connecting/onprem-to-atlas.txt b/source/connecting/onprem-to-atlas.txt index c8f29b1e6..d65b11478 100644 --- a/source/connecting/onprem-to-atlas.txt +++ b/source/connecting/onprem-to-atlas.txt @@ -61,5 +61,4 @@ Limitations Example ------- -.. include:: /includes/example-connect - +.. include:: /includes/example-connect-onprem-atlas.rst diff --git a/source/includes/example-connect-atlas.rst b/source/includes/example-connect-atlas.rst new file mode 100644 index 000000000..73e8551f3 --- /dev/null +++ b/source/includes/example-connect-atlas.rst @@ -0,0 +1,50 @@ +Gather Connection Information +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The source cluster, ``cluster0``, is hosted on the following servers +and ports: + +- clusterOne-shard-00-00.abc12.mongodb.net:27017 +- clusterOne-shard-00-01.abc12.mongodb.net:27017 +- clusterOne-shard-00-02.abc12.mongodb.net:27017 + +The destination cluster, ``cluster1``, is hosted on the following +servers and ports: + +- clusterTwo-shard-00-00.abc12.mongodb.net:27017 +- clusterTwo-shard-00-01.abc12.mongodb.net:27017 +- clusterTwo-shard-00-02.abc12.mongodb.net:27017 + +There is an administrative user, ``clusterAdmin`` configured on each +cluster with password, ``superSecret``. + +Connect the Source and Destination Clusters with ``mongosync`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Use the connection information you gathered to create the connection +strings for ``cluster0`` and ``cluster1``: + +.. code-block:: shell + + cluster0: + mongodb+srv://clusterAdmin:superSecret@clusterOne.abc12.mongodb.net + cluster1: + mongodb+srv://clusterAdmin:superSecret@clusterTwo.abc12.mongodb.net + +.. note:: + + Atlas clusters require TLS connections. To use ``mongosync`` with Atlas + clusters, add the :urioption:`tls=true ` option or use the + ``mongodb+srv`` connection string format. For more details about + ``mongodb+srv`` connection strings, see :ref:`connections-dns-seedlist`. + + +The ``mongosync`` command layout below is modified for display. To +connect ``cluster0`` to ``cluster1`` with ``mongosync``, enter the +following command on one line: + +.. code-block:: shell + + mongosync \ + --cluster0 "mongodb+srv://clusterAdmin:superSecret@clusterOne.abc12.mongodb.net" \ + --cluster1 "mongodb+srv://clusterAdmin:superSecret@clusterTwo.abc12.mongodb.net" diff --git a/source/includes/example-connect-onprem-atlas.rst b/source/includes/example-connect-onprem-atlas.rst new file mode 100644 index 000000000..e099c04d8 --- /dev/null +++ b/source/includes/example-connect-onprem-atlas.rst @@ -0,0 +1,50 @@ +Gather Connection Information +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +The source cluster, ``cluster0``, is hosted on the following servers +and ports: + +- clusterOne01.fancyCorp.com:20020 +- clusterOne02.fancyCorp.com:20020 +- clusterOne03.fancyCorp.com:20020 + +The destination cluster, ``cluster1``, is hosted on the following +servers and ports: + +- clusterTwo-shard-00-00.abc12.mongodb.net:27017 +- clusterTwo-shard-00-01.abc12.mongodb.net:27017 +- clusterTwo-shard-00-02.abc12.mongodb.net:27017 + +There is an administrative user, ``clusterAdmin`` configured on each +cluster with password, ``superSecret``. + +Connect the Source and Destination Clusters with ``mongosync`` +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Use the connection information you gathered to create the connection +strings for ``cluster0`` and ``cluster1``: + +.. code-block:: shell + + cluster0: + mongodb://clusterAdmin:superSecret@clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020 + cluster1: + mongodb+srv://clusterAdmin:superSecret@clusterTwo.abc12.mongodb.net + +.. note:: + + Atlas clusters require TLS connections. To use ``mongosync`` with Atlas + clusters, add the :urioption:`tls=true ` option or use the + ``mongodb+srv`` connection string format. For more details about + ``mongodb+srv`` connection strings, see :ref:`connections-dns-seedlist`. + +The ``mongosync`` command layout below is modified for display. To +connect ``cluster0`` to ``cluster1`` with ``mongosync``, enter the +following command on one line: + +.. code-block:: shell + + mongosync \ + --cluster0 "mongodb://clusterAdmin:superSecret@clusterOne01.fancyCorp.com:20020,clusterOne02.fancyCorp.com:20020,clusterOne03.fancyCorp.com:20020" \ + --cluster1 "mongodb+srv://clusterAdmin:superSecret@clusterTwo.abc12.mongodb.net" +