Saturday, June 10, 2017

Failed to start mongod.service unit mongod.service not found. ubuntu 16.04

In this post I will show you how to resolve Failed to start mongod.service unit mongod.service not found.

Previously I had shown how to install MongoDB on Ubuntu & Windows

First Open Terminal and enter the below command.

sudo vim /etc/systemd/system/mongodb.service
Now it should look as shown below.























If it is not as shown above just copy & paste the below code and save.

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

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

[Install]
WantedBy=multi-user.target
Now with the below commands start the service and check its starte or not

sudo systemctl start mongodb
sudo systemctl status mongodb
and finally enable it permanently by using the below command

sudo systemctl enable mongodb

No comments:

Post a Comment