mongodb running error on cloud9

27 views
Skip to first unread message

manan maniyar

unread,
Jan 14, 2018, 4:57:43 PM1/14/18
to mongodb-user

completed all the steps for installing mongodb on c9 but when running mongo command to start the db the error shows:

MongoDB shell version: 2.6.12
connecting to: test
2018-01-14T08:23:39.571+0000 warning: Failed to connect to 127.0.0.1:27017, reason: errno:111 Connection refused
2018-01-14T08:23:39.572+0000 Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at src/mongo/shell/mongo.js:146
exception: connect failed

can you help me please ?

Gaurav Gupta

unread,
Jan 29, 2018, 11:18:48 PM1/29/18
to mongodb-user

Hi Manan,

Generally the error message “Connection refused” indicates that there are no MongoDB servers reachable given your connection options.

First ensure that there is a MongoDB server running locally. Another possibility is that you’re running mongod with —bind_ip flag. If this is the case, you can try connecting using mongo shell as below:

mongo --host $IP --port 27017

completed all the steps for installing

Which installation tutorial did you follow?
Please note that MongoDB 2.6 has reached its end of life on October 2016. For general enhancements and bug fixes I would recommend to use the latest stable version of MongoDB v3.6. Please follow the installation instructions on Install MongoDB on Linux.

You may also be interested in Security Checklist which covers topic such as Limiting Network Exposure.

Regards,
Gaurav

Reply all
Reply to author
Forward
0 new messages