Install MongoDB

0

I asked before but could not solve it, I gave it some time, I tried again and I still have problems starting MongoDB. I removed it from my Ubuntu 18.04 computer and am re-installing it based on the documentation of the mongo, after installed when I start the following message appears

  

Failed to start mongod.service: Unit mongod.service not found.

    
asked by anonymous 28.12.2018 / 15:19

2 answers

1

If the service does not exist, then you create it

1: Save the file as mongodb.service in the following PATH: /etc/systemd/system/mongodb.service;

  

[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

2: Try to run again [sudo] systemctl start mongodb

    
28.12.2018 / 17:16
2

Most likely the mongodb.service drive is masked. Use the following command to unmask.

sudo systemctl unmask mongodb

and run again

sudo service mongod start
    
28.12.2018 / 15:30