Atanu Samanta
Atanu Samanta

Reputation: 175

how to make mongo db start after ubuntu startup

mongo connection failed in terminal every time after ubuntu startup then after running the command sudo service mongod start it is working fine. I am using ubuntu 18.04. How to fix it that it may run always without the above command?

Upvotes: 1

Views: 106

Answers (1)

m21
m21

Reputation: 76

Try below:

sudo systemctl enable mongod

Reboot your machine and check if the service is up.

sudo systemctl status mongod

Checking out the manpage will give you a lot of information.

See systemctl manpage

http://manpages.ubuntu.com/manpages/cosmic/en/man1/systemctl.1.html

Upvotes: 1

Related Questions