Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DOCSP-47829 - Docker directConnection note #99

Merged
merged 2 commits into from
Mar 28, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions dbx/docker-replica-set.rst
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
.. note:: Replica Set in Docker
When a replica set runs in Docker, it might expose only one MongoDB endpoint.
In this case, the replica set is not discoverable. Specifying ``directConnection=false`` in your connection URI,
or leaving this option unset, can prevent your application from connecting to it.

To connect to a replica set running in one or more Docker containers,
specify ``directConnection=true`` in your connection URI.
In a test or development environment, you can connect to the replica set by specifying
``directConnection=true``. In a production environment, we
recommend configuring the cluster to make each MongoDB instance accessible outside of
the Docker virtual network.