Error connecting from linux console

gettings this error when connecting form console
please help

parallels@debian-gnu-linux-vm:~$ mongo mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017 -u m001-student -p
MongoDB shell version: 3.2.11
Enter password:
connecting to: mongodb://cluster0-shard-00-00-jxeqq.mongodb.net:27017
2018-11-20T19:51:19.669-0500 E QUERY [thread1] Error: network error while attempting to run command ‘isMaster’ on host ‘cluster0-shard-00-00-jxeqq.mongodb.net:27017’ :
connect@src/mongo/shell/mongo.js:223:14
@(connect):1:6

exception: connect failed

@Soy_80183 I believe you need to specify more than just the first node in the cluster, if the first node is not marked as master that >might< be the cause of the error you are seeing. For the class I think the full connect command looks like this:

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

Note, there are 3 nodes specified, and the URL portion is enclosed in quotes.

HTH,
Mike

1 Like

im confused didnt work

ok i made it in with a slight modificaiton Thanks a lot