sudo service mongodb restart gives "unrecognized service error" in ubuntu 14.0.4 sudo service mongodb restart gives "unrecognized service error" in ubuntu 14.0.4 mongodb mongodb

sudo service mongodb restart gives "unrecognized service error" in ubuntu 14.0.4


Try this:

Write mongodb instead of mongod

sudo service mongodb status


I got the same error one day You should use this:

1.Get the status of your mongo service:

 /etc/init.d/mongod status

or

 sudo service mongod status

2.If it's not started repair it like this:

sudo rm /var/lib/mongodb/mongod.lockmongod --repairsudo service mongodb start

And check again if the service is started again(1)


For me the solution was to replace

service mongod start

with

start mongod