mongo - couldn't connect to server 127.0.0.1:27017

mongodb, pymongo

Solution

This error is what you would see if the mongo shell was not able to talk to the mongod server.

This could be because the address was wrong (host or IP) or that it was not running. One thing to note is the log trace provided does not cover the "Fri Nov 9 16:44:06" of your `mongo timestamp`.

Can you:

- Provide the command line arguments (if any) used to start your mongod process

- Provide the log file activity from the mongod startup as well as logs during the mongo shell startup attempt?

- Confirm that your mongod process is being started on the same machine as the mongo shell?

Problem

I am coming from riak and redis where I never had an issue with this services starting, or to interact. This is a pervasive problem with mongo and am rather clueless. Restarting does not help.I am new to mongo. ``` mongo MongoDB shell version: 2.2.1 connecting to: test Fri Nov 9 16:44:06 Error: couldn't connect to server 127.0.0.1:27017 src/mongo/shell/mongo.js:91 exception: connect failed ``` This is what I see in the logs. ``` now open) Fri Nov 9 16:44:34 [conn47] end connection 10.29.16.208:5306 (1 connection now open) Fri Nov 9 16:45:04 [initandlisten] connection accepted from 10.29.16.208:5307 #48 (2 connections now open) Fri Nov 9 16:45:04 [conn48] end connection 10.29.16.208:5307 (1 connection now open) Fri Nov 9 16:45:04 [initandlisten] connection accepted from 10.29.16.208:5308 #49 (2 connections now open) Fri Nov 9 16:45:04 [conn49] end connection 10.29.16.208:5308 (1 connection now open) Fri Nov 9 16:45:34 [initandlisten] connection accepted from 10.29.16.208:5316 #50 (2 connections now open) Fri Nov 9 16:45:34 [conn50] end connection 10.29.16.208:5316 (1 connection now open) Fri Nov 9 16:45:34 [initandlisten] connection accepted from 10.29.16.208:5317 #51 (2 connections now open) Fri Nov 9 16:45:34 [conn51] end connection 10.29.16.208:5317 (1 connection now open) Fri Nov 9 16:46:04 [initandlisten] connection accepted from 10.29.16.208:5320 #52 (2 connections now open) Fri Nov 9 16:46:04 [conn52] end connection 10.29.16.208:5320 (1 connection now open) Fri Nov 9 16:46:04 [initandlisten] connection accepted from 10.29.16.208:5321 #53 (2 connections now open) Fri Nov 9 16:46:04 [conn53] end connection 10.29.16.208:5321 (1 conn ```

Original source