Document Database Service

Connection error: URL without replica set configuration

2025-07-29 02:44:07

Issue Description

An error occurs when connecting to the DDS replica set instance using the following command:

mongo mongodb://root:<password>@<IP1:Port1>,<IP2:Port2>/admin?authSource=admin&replicaSet=<setname>

Error message:

FailedToParse: Cannot list multiple servers in URL without 'replicaSet' option

Cause Analysis

Possible reasons:

• The client version and the DDS version do not match.

• The command entered is not in the correct format.

Solution

  1. Ensure that the client and server versions used are consistent.

  2. Ensure that the replicaSet setting is specified correctly in the Connection URI.

  3. Enclose the Connection URI in double quotes; otherwise, the command may run in the background because the URI contains '&' character.


ASjj8IMgKf1i