I am trying to connect with mongodb, But it is giving me error.
MongoDB shell version: 3.2.22 connecting to: test 2019-09-07T05:17:09.460+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused 2019-09-07T05:17:09.461+0000 E QUERY
[thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:229:14 @(connect):1:6
Tried:
sudo nano /etc/mongod.conf
- Commenting bindip
#network interfaces
net:
port : 2701
#bindip = [0.0.0.0]
- Setting up this to
#network interfaces
net:
port : 2701
bindip : 0.0.0.0
- Setting up this to
#network interfaces
net:
port : 2701
bind_ip = 0.0.0.0
- Setting up this to
#network interfaces
net:
port : 2701
bindip = [0.0.0.0]
Saved this file then :
sudo service mongod restart mongo
Again connection refused giving same error :
MongoDB shell version: 3.2.22 connecting to: test 2019-09-07T05:17:09.460+0000 W NETWORK [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: errno:111 Connection refused 2019-09-07T05:17:09.461+0000 E QUERY
[thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed : connect@src/mongo/shell/mongo.js:229:14 @(connect):1:6
Any Help?