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
Make sure that your mongo is running. I fixed this problem by trying to repair the mongodb, there I found that the directory required for the db to run was not created. It shows this error
Type: mongod
, it will show the error
exception in initAndListen: 29 Data directory /data/db not found., terminating
Error happen because dbpath /data/db/
(default config) does not exist. You need to create data folder and set permission for it.
Then I create a folder on my system by the command
sudo mkdir -p /data/db/
and
sudo chown id -u
/data/db
then I run the mongo again and it worked.