I have recently upgraded my ubuntu from 14.10 to 15.04. All features seems to be working fine except MongoDB
. I am using mongoDB with ruby on rails application using Mongoid gem. MongoDB is not controllable from service as we do normally in ubuntu.
sudo service mongodb start
or
sudo service mongod start
I get this error message
Failed to restart mongod.service: Unit mongod.service failed to load: No such file or directory.
But i have to start it manually each time i have to connect my application to MongoDB server using
sudo mongod -f /etc/mongod.conf
So mongodb
is connected as long as that terminal is opened. I am using MongoDB
in Ruby on Rails application using Mongoid adapater/ORM
.
When i run
sudo service mongodb status
i get following output
mongodb.service - An object/document-oriented database
Loaded: loaded (/lib/systemd/system/mongodb.service; enabled; vendor preset: enabled)
Active: failed (Result: exit-code) since بدھ 2015-05-06 14:47:53 PKT; 5s ago
Docs: man:mongod(1)
Process: 28602 ExecStart=/usr/bin/mongod --config /etc/mongodb.conf (code=exited, status=4)
Main PID: 28602 (code=exited, status=4)
مٓی 06 14:47:53 NX00443 systemd[1]: Started An object/document-oriented database.
مٓی 06 14:47:53 NX00443 systemd[1]: Starting An object/document-oriented database...
مٓی 06 14:47:53 NX00443 systemd[1]: mongodb.service: main process exited, code=exited, status=4/NOPERMISSION
مٓی 06 14:47:53 NX00443 systemd[1]: Unit mongodb.service entered failed state.
مٓی 06 14:47:53 NX00443 systemd[1]: mongodb.service failed.
Any help in this regard will be appreciated.
None of the above solution worked for me. There are few kernel level changes in ubuntu 15.04 and they are not going to resolve this issue in current release. Hopefully it will be fixed in next stable release of ubuntu.