M001; Chapter 2: Atlas connection to Shell

This is the code provided by Atlas; only password has been added. Still, connection failed. Any suggestions?

mongo “mongodb://cluster0-shard-00-00-zabqg.mongodb.net:27017,cluster0-shard-00-01-zabqg.mongodb.net:27017,cluster0-shard-00-02-zabqg.mongodb.net:27017/test?replicaSet=cluster0-shard-0” --ssl --authenticationDatabase admin --username m001-student --password m001-mongodb-basics

I changed cluster0 into sandbox but it did not help either.

Thanks!

Hi Vladimir_06262,

The command is totally right except the replicaSetName, it is case sensitive, use “Cluster0-shard-0”

mongo "mongodb://cluster0-shard-00-00-zabqg.mongodb.net:27017,cluster0-shard-00-01-zabqg.mongodb.net:27017,cluster0-shard-00-02-zabqg.mongodb.net:27017/test?replicaSet=Cluster0-shard-0" --ssl --authenticationDatabase admin --username m001-student --password m001-mongodb-basics

Kanika

It works now…

Thanks Kanika!

My output is does not show that I am connected to Sandbox cluster but cluster0 . Why is that?

See my output:

PS C:\Users\Vladimir> mongo “mongodb://cluster0-shard-00-00-zabqg.mongodb.net:27017,cluster0-shard-00-01-zabqg.mongodb.net:27017,cluster0-shard-00-02-zabqg.mongodb.net:27017/test?replicaSet=Cluster0-shard-0” --ssl --authenticationDatabase admin --use
password m001-mongodb-basics
MongoDB shell version v4.0.5
connecting to: mongodb://cluster0-shard-00-00-zabqg.mongodb.net:27017,cluster0-shard-00-01-zabqg.mongodb.net:27017,cluster0-shard-00-02-zabqg.mongodb.net:27017/test?authSource=admin&gssapiServiceName=mongodb&replicaSet=Cluster0-shard-0
2019-01-22T09:14:50.434-0500 I NETWORK [js] Starting new replica set monitor for Cluster0-shard-0/cluster0-shard-00-00-zabqg.mongodb.net:27017,cluster0-shard-00-01-zabqg.mongodb.net:27017,cluster0-shard-00-02-zabqg.mongodb.net:27017
2019-01-22T09:14:50.825-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to cluster0-shard-00-01-zabqg.mongodb.net:27017 (1 connections now open to cluster0-shard-00-01-zabqg.mongodb.net:27017 with a 5 second timeout)
2019-01-22T09:14:50.825-0500 I NETWORK [js] Successfully connected to cluster0-shard-00-02-zabqg.mongodb.net:27017 (1 connections now open to cluster0-shard-00-02-zabqg.mongodb.net:27017 with a 5 second timeout)
2019-01-22T09:14:51.176-0500 I NETWORK [ReplicaSetMonitor-TaskExecutor] Successfully connected to cluster0-shard-00-00-zabqg.mongodb.net:27017 (1 connections now open to cluster0-shard-00-00-zabqg.mongodb.net:27017 with a 5 second timeout)
Implicit session: session { “id” : UUID(“93cd8a0c-cdf6-4ce6-ae0f-9b9b193c666d”) }
MongoDB server version: 4.0.5
Error while trying to show server startup warnings: user is not allowed to do action [getLog] on [admin.]
MongoDB Enterprise Cluster0-shard-0:PRIMARY>
MongoDB Enterprise Cluster0-shard-0:PRIMARY> show dbs
admin 0.000GB
local 3.006GB
MongoDB Enterprise Cluster0-shard-0:PRIMARY>

It will show you the Cluster name which is set to Cluster0-shard-0 and not Sandbox.

Kanika

Thanks again!

I hope to finish today before the deadline!!!