Could not connect to M121 Atlas Cluster

Comand : mongo “mongodb://,,” --authenticationDatabase admin --ssl -u m121 -p aggregations --norc

Error : vagrant@m103:~ mongo "mongodb://, 7," --authenticationDatabase admin --ssl -u m121 -p aggregations --norc MongoDB shell version v3.6.7 connecting to: mongodb://,, 2019-02-13T12:33:26.261+0000 I NETWORK [thread1] Starting new replica set monitor for Cluster0-shard-0/,, 2019-02-13T12:33:36.283+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] getaddrinfo("") failed: Name or service not known 2019-02-13T12:33:36.290+0000 I NETWORK [thread1] getaddrinfo("") failed: Name or service not known 2019-02-13T12:33:46.308+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] getaddrinfo("") failed: Name or service not known 2019-02-13T12:33:46.309+0000 W NETWORK [ReplicaSetMonitor-TaskExecutor-0] Unable to reach primary for set Cluster0-shard-0 2019-02-13T12:33:46.309+0000 I NETWORK [ReplicaSetMonitor-TaskExecutor-0] 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. 2019-02-13T12:33:46.310+0000 E QUERY [thread1] Error: connect failed to replica set Cluster0-shard-0/,, : connect@src/mongo/shell/mongo.js:251:13 @(connect):1:6 exception: connect failed vagrant@m103:~

Hi. It seems your network connection shut down or you haven’t run you mongodb instance.

1 Like

@ Nidhyanantham

It appears that you’re using a Vagrant VM from another course (M103). I would suggest that you test this from your own system, or spin up a new Vagrant box. Each Vagrant setup for a course includes various provisioning settings, some of which may prevent you from accessing the network.

I am unable to connect from Compass as well.

It is throwing error that
Could not connect to MongoDB on the provided host and port

What could be the reason for this ?

I’m a little bit confusing.
So, you can’t connect to MongoDB from Compass or through Vagrant?
Vagrant’s a course M103 and yes, there are some difficulties - I know cause I learn it right now.

@ Nidhyanantham

I’m really not sure what you’ve done here. Did you take my recommendations and try this some other ways? I spooled up a simple Vagrant VM with MongoDB installed and could connect with no problem. You have not explained why you’re using a VM from another course, which is most likely your error. If you’re trying to take both these courses at once, I would strongly recommend not using a VM for this course, but simply connecting directly from your command line,