Connect Failed on The Mongod "Lab 1"

Connection string:

 mongod --dbpath /data/db/ --port 27000 --bind_ip 192.168.103.100

I get connection failed on the second terminal window after starting mongod

vagrant@m103:~$ mongo --port 27000
MongoDB shell version v3.6.17
connecting to: mongodb://127.0.0.1:27000/?gssapiServiceName=mongodb
2020-02-24T18:22:18.105+0000 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27000, in(checking socket for error after poll), reason: Connection refused
2020-02-24T18:22:18.107+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
vagrant@m103:~$ 

What could be the problem? I have tried different solutions but it wouldn’t connect still

Your mongod was started on 192.168.103.100 alone.

But you’re trying to connect on localhost (127.0.0.1)

Refer to the documentation on bind_ip.

1 Like

Thank you, I discovered that and had fixed the error

:slightly_smiling_face: :+1:

2 posts were split to a new topic: Error parsing YAML file (Configuration file)

Closing this thread as the issue has been resolved.