LearningWebAppDev
LearningWebAppDev copied to clipboard
problem connecting to mongo
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?
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.
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.