Debian - Run mongodb when booting

0

I have a problem with Debian 9, I can not find a way (Google) to make mongodb run as soon as I load the operating system.

I have installed Debian 9 without a graphical environment. I've tried:

systemctl enable mongod.service

And it does not happen absolutely nothing , it does not work. How can I then make mongodb run as soon as the system is loaded?

  

Note: mongod --dbpath /var/lib/mongodb --port 27017 runs perfectly and it's just that line of "code" what I want to run as soon as I boot the system.

    
asked by Máxima Alekz 03.10.2017 в 18:40
source

1 answer

1

I found the answer, after both rolling information and testing.

To install mongodb as a service:

You have to be root yes or yes

sudo apt-get install mongodb-server

To start the MongoDB service

#Debes ser root
service mongodb start

To configure mongodb

nano /etc/mongodb.conf

Restart the mongodb service

#Debes ser root
service mongodb restart

#Tambíen podrías:
service mongodb stop
service mongodb start
    
answered by 12.10.2017 / 17:43
source