Instalar Mongodb

Asked

Viewed 55 times

0

I’ve asked before but I couldn’t solve it, I took some time, I tried again and I’m still having trouble starting Mongodb. I removed it from my Ubuntu 18.04 computer and am installing again based on documentation from Mongo itself, after installed when I start the following message appears

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

inserir a descrição da imagem aqui

3 answers

2

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

sudo systemctl unmask mongodb

and run again

sudo service mongod start
  • I get this reply "Unit mongodb.service does not exist, proceeding anyway."

  • You are typing in the first command "mongodb" and the second "mongod"?

  • the first command

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

0

To solve this problem I use these commands:

sudo systemctl daemon-Reload

sudo systemctl status mongod

sudo systemctl enable mongod

sudo systemctl stop mongod

sudo systemctl Restart mongod

And it went back to working badly after reinstalling it, but it certainly would have worked without reinstalling

Browser other questions tagged

You are not signed in. Login or sign up in order to post.