KeplerGrid guide

MongoDB replica set connection string examples

Use a seed list to discover the primary, then diagnose unreachable advertised hosts and single-endpoint Docker setups.

Use reachable members and the set name

For this example, a three-member development replica set called kg-dev listens on localhost ports 27101 through 27103. Substitute your member addresses and replica set name. In KeplerGrid use Connection string or the Replica set form with these member addresses and ports.

mongodb://127.0.0.1:27101,127.0.0.1:27102,127.0.0.1:27103/keplergrid_start?replicaSet=kg-dev

Run Test connection. With normal replica-set discovery and the default primary read preference, the driver uses the elected primary. After a healthy election, the driver can select the new primary. An operation can still fail during the election.

Check the addresses the set advertises

On a reachable member, db.hello().hosts lists advertised addresses. Check those exact hostnames and ports from the desktop client’s network path. This matters when a container advertises names available only inside its own network.

Connect to one published member for local development

If a disposable local Docker set publishes a single reachable endpoint, use a direct connection when you want to inspect that member. Adjust the port to the published host port.

mongodb://127.0.0.1:27101/keplergrid_start?directConnection=true

A direct connection stays on that member. Use normal discovery to follow the primary. If using SSH, follow the dedicated guide for host verification and reaching the advertised members.

Connect to a replica set over SSH · Connect a desktop GUI to Docker · MongoDB directConnection option