Help Center> Document Database Service> User Guide> Troubleshooting> Mongo Shell Fails to Connect to the DB Instance, Leaving Message "isMaster"

Mongo Shell Fails to Connect to the DB Instance, Leaving Message "isMaster"

Symptom

An error is reported when you run the following command to connect to a DDS DB instance:

./mongo --host 192.168.168.182 --port 8635 -u rwuser -p xxxxxxxxxx --authenticationDatabase admin

Figure 1 Connection failed

Possible Cause

This preceding command is used to connect to a DB instance in non-SSL mode. If the SSL connection is enabled, an error is reported when you run this command.

Solution

  • Run the following command disable SSL connection and use a common connection to connect to the DB instance:
  • Download the SSL certificate, upload the certificate to the ECS directory (for example, /root/ca.crt), and run the command in SSL mode to connect to the instance.

    You can click the DB instance name on the DDS console, click next to SSL on the Connections page, and download the SSL certificate.

    ./mongo --host 192.168.168.182 --port 8635 -u rwuser -p xxxxxxxxxx --authenticationDatabase admin --ssl --sslCAFile /root/ca.crt --sslAllowInvalidHostnames

    Figure 2 Connection succeeded