Lab - Configuration File - ... connection refused ... couldn't connect to server 127.0.0.1:27000, connection attempted failed

image

vagrant@m103:~$ mongo --port 27000
MongoDB shell version v3.6.12
connecting to: mongodb://127.0.0.1:27000/?gssapiServiceName=mongodb
2019-11-19T23:38:43.760+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27000, in(checking socket for error after poll), reason: Connection refused
2019-11-19T23:38:43.761+0000 E QUERY [thread1] Error: couldn’t connect to server 127.0.0.1:27000, connection attempt failed :
connect@src/mongo/shell/mongo.js:263:13
@(connect):1:6
exception: connect failed”

Why can’t I log in to mongo shell??

image

Hi @Guy_40794,

As I can see in the screenshot, I am guessing that you have provided incorrect parameter to the bindIp option in your configuration file and that’s why you are not able to connect to that mongod instance.

Please refer the Lecture: Configuration File to know more about how to bind the ips in your configuration file.

Hope it helps!

If the issue still persists then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer