0

This has been asked before, but I can't seem to get this resolved for me from other answers.

I am getting the following error when trying to run mongo on OSX Yosemite:

2015-11-27T11:50:51.644+0000 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused 2015-11-27T11:50:51.645+0000 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at connect (src/mongo/shell/mongo.js:179:14) at (connect):1:6 at src/mongo/shell/mongo.js:179

I installed via brew.

People have mentioned a /data/db directory (which I can't find) and removing a mongo.lock file (which I can't find either).

I can see mongo files located at /usr/local/bin, but no lock files.

Thank you

zeKoko
  • 437
  • 1
  • 7
  • 19

1 Answers1

2

I installed on my mac MongoDB few days ago. You can follow for this Link and complete all steps. It's quite easy to install MongoDB on mac.

Additional information :

Link, Failed to unlink socket file

I hope it will help you.

Thanks!

Community
  • 1
  • 1
  • it depends on what you did before) –  Nov 27 '15 at 12:08
  • Installed via Homebrew – zeKoko Nov 27 '15 at 12:09
  • @zeKoko `cd /data/db` and you will see if this path exists. This is folder where MongoDB store data. I've installed it manually –  Nov 27 '15 at 12:11
  • Ok, I uninstalled, followed the instructions in the Link above and got the following error: 2015-11-27T12:20:30.458+0000 E NETWORK [initandlisten] Failed to unlink socket file /tmp/mongodb-27017.sock errno:13 Permission denied 2015-11-27T12:20:30.459+0000 I - [initandlisten] Fatal Assertion 28578 2015-11-27T12:20:30.459+0000 I - [initandlisten] ***aborting after fassert() failure – zeKoko Nov 27 '15 at 12:23
  • @zeKoko new [Link](http://stackoverflow.com/questions/29813648/failed-to-unlink-socket-file-error-in-mongodb-3-0) how to solve this error –  Nov 27 '15 at 12:27
  • Ok, removed that and ran mongod and got a load of info, last 2 lines were: 2015-11-27T12:32:21.129+0000 I STORAGE [FileAllocator] done allocating datafile /data/db/local.0, size: 64MB, took 0.13 secs 2015-11-27T12:32:21.194+0000 I NETWORK [initandlisten] waiting for connections on port 27017. Now there is just a blinking cursor. – zeKoko Nov 27 '15 at 12:33
  • Ran `mongo` and got: 2015-11-27T12:34:42.855+0000 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused 2015-11-27T12:34:42.856+0000 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at connect (src/mongo/shell/mongo.js:179:14) at (connect):1:6 at src/mongo/shell/mongo.js:179 – zeKoko Nov 27 '15 at 12:35
  • Great, you've run a mongodb server. Now you can connect to it through any api or iterm just tipe `mongo' –  Nov 27 '15 at 12:35
  • `mongo` doesn't work, give me the following error: 2015-11-27T12:36:05.697+0000 W NETWORK Failed to connect to 127.0.0.1:27017, reason: errno:61 Connection refused 2015-11-27T12:36:05.699+0000 E QUERY Error: couldn't connect to server 127.0.0.1:27017 (127.0.0.1), connection attempt failed at connect (src/mongo/shell/mongo.js:179:14) at (connect):1:6 at src/mongo/shell/mongo.js:179 – zeKoko Nov 27 '15 at 12:36
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/96355/discussion-between-naz-and-zekoko). –  Nov 27 '15 at 12:39