LearningWebAppDev icon indicating copy to clipboard operation
LearningWebAppDev copied to clipboard

problem connecting to mongo

Open sineau opened this issue 9 years ago • 2 comments

I have problem running mongo. After starting mongodb service, commanding mongo would result: Error: couldn't connect to server 127.0.0.1:27017 at src/mongo/shell/mongo.js:145 ‍‍‍‍‍‍ And running mongod would result: ERROR: dbpath (/data/db/) does not exist. After creating this directory and running sudo mongod, it would hangs on: [websvr] admin web console waiting for connections on port 28017 any help?

sineau avatar Jul 27 '15 23:07 sineau

Hello! Sorry for the trouble. It sounds like something got corrupted during the VM creation. I'd recommend rebuilding your virtual machine in this case. Basically, try doing the following:

$ vagrant destroy

Then

$ vagrant up

This will remove anything from your shared folders, so make sure you copy anything you want to save somewhere before you do it.

semmypurewal avatar Jul 30 '15 13:07 semmypurewal

I did the same thing to fix the problem. However I have to manually remove /var/lib/mongodb/mongodb.lock every time I'm going to run mongo.

sineau avatar Aug 01 '15 14:08 sineau