Previously I had shown how to install MongoDB on Ubuntu & Windows
- How to Install MongoDB on Ubuntu 16.04
- How to Install MongoDB in Windows
- How to Run MongoDB as Windows service
- How to check MongoDB is running or not
- Asp.Net MVC with MongoDB
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