Ubuntu – MongoDB 3.0.2 won’t start after upgrading to Ubuntu 15.10

15.10mongodb

I recently upgraded to Ubuntu 15.10 after which MongoDB 3.0.2 is not starting.

$ sudo service mongod start

which would throw error:

Failed to start mongod.service: Unit mongod.service failed to load: No such file or directory.

Best Answer

It's just the lack of a service file for systemd. No need to go back to upstart like Kartik did or use a different repository than described in https://docs.mongodb.org/manual/installation/.

Create a file /lib/systemd/system/mongodb.service with the following content:

[Unit]
Description=High-performance, schema-free document-oriented database
After=network.target

[Service]
User=mongodb
ExecStart=/usr/bin/mongod --quiet --config /etc/mongodb.conf

[Install]
WantedBy=multi-user.target