I cannot connect to the "Dedicated" cluster from mongodb shell

Hi, I am trying to connect to the cloud cluster via mongodb shell, but I get the following error:

maikol@ubuntu20:/usr/local/mongodb/mongodb-4.4/bin$ ./mongosh “mongodb+srv://clusterhz.iug22.mongodb.net/” --username maikol_mongodb
Enter password: ******
Current Mongosh Log ID: 652299532e44d7a611ee6990
Connecting to: mongodb+srv://@clusterhz.iug22.mongodb.net/?appName=mongosh+1.10.6
Error: querySrv ESERVFAIL _mongodb._tcp.clusterhz.iug22.mongodb.net

I have the IP set correctly, and if I connect to the free cluster it connects. This clusterhz is a “Dedidacted” cluster, tier M50, with 2 Shards. I don’t know why it doesn’t works.

Greetings.

Looks like the DNS server you are using is not resolving the cluster.

If you select older versions in the ‘Connect’ dialog in Atlas you will get the legacy connection string which may work work better for you, or switch DNS servers.

The Cluster resolves fine for me:

11:16 $ dig +short srv _mongodb._tcp.clusterhz.iug22.mongodb.net; dig +short txt clusterhz.iug22.mongodb.net
0 0 27016 clusterhz-shard-00-00.iug22.mongodb.net.
0 0 27016 clusterhz-shard-01-02.iug22.mongodb.net.
0 0 27016 clusterhz-shard-01-01.iug22.mongodb.net.
0 0 27016 clusterhz-shard-01-00.iug22.mongodb.net.
0 0 27016 clusterhz-shard-00-02.iug22.mongodb.net.
0 0 27016 clusterhz-shard-00-01.iug22.mongodb.net.
"authSource=admin"

Hello, thanks for your answer, but I don’t know if it worked, I get the following text.

{“t”:{“$date”:“2023-10-08T16:28:50.727Z”},“s”:“W”, “c”:“CONTROL”, “id”:23321, “ctx”:“main”,“msg”:“Option: This name is deprecated. Please use the preferred name instead.”,“attr”:{“deprecatedName”:“ssl”,“preferredName”:“tls”}}
MongoDB shell version v4.4.24
connecting to: mongodb://clusterhz-shard-00-00.iug22.mongodb.net:27016/?authSource=admin&compressors=disabled&gssapiServiceName=mongodb
{“t”:{“$date”:“2023-10-08T16:28:50.844Z”},“s”:“I”, “c”:“NETWORK”, “id”:5490002, “ctx”:“thread1”,“msg”:“Started a new thread for the timer service”}
Implicit session: session { “id” : UUID(“09ba958d-c8db-4a84-a0c3-d280483f4a90”) }
MongoDB server version: 6.0.10
WARNING: shell and server versions do not match
MongoDB Enterprise mongos>

Yes, quite right switch ssl=true to tls=true.

But yes it worked,

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.