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
In my case:
First I open config file
sudo vi /etc/mongodb.conf
Comment IP and Port like this
#bind_ip = 127.0.0.1
#port = 27017
Then restart mongodb
sudo service mongodb restart
sudo service mongod restart
Finally, it's work :D
finn@Finn ~ $ mongo
MongoDB shell version: 2.4.9
connecting to: test
> exit
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:
I also have the same problem then I got fixed by these two lines of code. Hope, it helps
systemctl start mongod
systemctl enable mongod
I face same issue after searching a lot I solve this by following :
sudo service mongodb stop
sudo rm /var/lib/mongodb/mongod.lock
sudo mongod --repair --dbpath /var/lib/mongodb
sudo mongod --fork --logpath /var/lib/mongodb/mongodb.log --dbpath /var/lib/mongodb
sudo service mongodb start
Create the folder C:data/db if it doesn't already exist on your computer. Turns out MongoDB requires the existence of this folder structure 'data/db' to run. I hope this helps someone.
A little to late with the answer but I've encountered the same issue
Following are the steps which helped me.
c:\MongoDB\Server\3.4\bin
"Run using a GUI, EX "robomongo"
Or
open new terminal (CMD) -> go to EX:"c:\MongoDB\Server\3.4\bin
"
type in "mongo" command