Tag Archives: mongodb

Error: couldn’t connect to server shell/mongo.js:84 – SOLVED

I was having an issue on Mac OS X – this is probably because I installed it with homebrew a few months back and forgot about these instructions. $mongodb MongoDB shell version: 2.0.6 connecting to: test Sat Jun 16 09:11:43 exception: connect failed Error: couldn’t connect to server shell/mongo.js:84 I search for a solution but didn’t easily find one, so I ended up uninstalling it and reinstalling it, which then gave me the very valuable notes below about where config files and data paths are stored on OSX, and also let me know that I needed to start the service if I wanted to use it. Here are those notes: Downloading http://fastdl.mongodb.org/osx/mongodb-osx-x86_64-2.0.6.tgz Already downloaded: /Users/me/Library/Caches/Homebrew/mongodb-2.0.6-x86_64.tgz Caveats If this is your first install, automatically load on login with: mkdir -p ~/Library/LaunchAgents cp /usr/local/Cellar/mongodb/2.0.6-x86_64/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist If this is an upgrade and you already have the homebrew.mxcl.mongodb.plist loaded: launchctl unload -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist cp /usr/local/Cellar/mongodb/2.0.6-x86_64/homebrew.mxcl.mongodb.plist ~/Library/LaunchAgents/ launchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mongodb.plist Or start it manually: mongod run –config /usr/local/etc/mongod.conf The launchctl plist above expects the config file to be at /usr/local/etc/mongod.conf Summary /usr/local/Cellar/mongodb/2.0.6-x86_64: 18 files, 122M, built in 2 seconds You might want to run brew update and brew upgrade to update / upgrade all of your homebrew packages, or brew update and brew upgrade mongodb to update mongodb to the latest version. A few other notes if you’re using homebrew: # updates the database of available software and what the latest # available version for each is. run this … Continue reading

Posted in Mac, Tech Tips | Tagged , , , | Leave a comment