Chapter2: Connecting to Atlas Cluster via Mongo Shell

Hello peeps,

I was unable to connect to the class Atlas cluster and I am also unable to connect to my own Atlas cluster with basically the same messages. I’m following the connection instructions provided by Atlas and using the following command (Keep in mind that my cluster name is Cluster0 and not Sandbox):

" mongo “mongodb+srv://cluster0-rx10h.mongodb.net/test” --username m001-student "

After this I’m prompted for the password which I input and I get the following message regarding the shell being unable to locate the primary or any nodes in the cluster:

connecting to: mongodb://cluster0-shard-00-00-rx10h.mongodb.net.:27017,cluster0-shard-00-01-rx10h.mongodb.net.:27017,cluster0-shard-00-02-rx10h.mongodb.net.:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0&ssl=true
2019-01-15T13:54:49.119-0800 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-rx10h.mongodb.net.:27017,cluster0-shard-00-01-rx10h.mongodb.net.:27017,cluster0-shard-00-02-rx10h.mongodb.net.:27017
2019-01-15T13:54:59.849-0800 W NETWORK [ReplicaSetMonitor-TaskExecutor] Unable to reach primary for set Cluster0-shard-0
2019-01-15T13:54:59.849-0800 I NETWORK [ReplicaSetMonitor-TaskExecutor] Cannot reach any nodes for set Cluster0-shard-0. Please check network connectivity and the status of the set. This has happened for 1 checks in a row.

After attempting to contact the other nodes (which it fails) I get the final message:

connect@src/mongo/shell/mongo.js:328:13
@(connect):1:6
exception: connect failed

Any ideas?

Hi Hernan_67132,

I am able to connect to your cluster as well. Please check your network connectivity and let me know.
Here is the command I used:

mongo "mongodb+srv://cluster0-rx10h.mongodb.net/test" --username m001-student --password m001-mongodb-basics

Kanika