Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

500
Visualizações
Mongodb - how to restart mongodb that you just killed in Linux?

How can I restart mongodb that I just killed in Linux?

Before killing:

$ service mongodb status
● mongodb.service - An object/document-oriented database
   Loaded: loaded (/lib/systemd/system/mongodb.service; disabled; vendor preset: enabled)
   Active: active (running) since Tue 2017-01-03 08:41:16 GMT; 4h 5min ago
     Docs: man:mongod(1)
 Main PID: 1036 (mongod)
    Tasks: 10
   Memory: 61.0M
      CPU: 1min 1.636s
   CGroup: /system.slice/mongodb.service
           └─1036 /usr/bin/mongod --config /etc/mongodb.conf

So I wanted to stop/ kill it for a while for other programs:

$ sudo kill 1036
$ service mongodb status
● mongodb.service - An object/document-oriented database
   Loaded: loaded (/lib/systemd/system/mongodb.service; disabled; vendor preset: enabled)
   Active: inactive (dead)
     Docs: man:mongod(1)

But how can I start it again?

I'm on Ubuntu 16.04.

EDIT:

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

EDIT 2:

Get this error below when I have the other program running on mondodb. so I killed that program and it works as before.

$ sudo systemctl start mongodb
$ service mongodb status
● mongodb.service - An object/document-oriented database
   Loaded: loaded (/lib/systemd/system/mongodb.service; disabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Tue 2017-01-03 13:05:19 GMT; 9s ago
     Docs: man:mongod(1)
  Process: 21732 ExecStart=/usr/bin/mongod --config /etc/mongodb.conf (code=exited, status=48)
 Main PID: 21732 (code=exited, status=48)
over 4 years ago · Santiago Trujillo
3 Respostas
Responde à pergunta

0

Ubuntu 16.04 LTS

sudo systemctl start mongodb

Not only for MongoDB, but for any application installed, you can use

sudo systemctl start <app_name>
sudo systemctl restart <app_name>
over 4 years ago · Santiago Trujillo Relatório

0

Seems like you are using systemd

Try:

systemctl start mongod -> Start the service

systemctl status mongod -> Status of service

systemctl restart mongod -> restart the service

systemctl reload mongod -> reload the service

over 4 years ago · Santiago Trujillo Relatório

0

You checked status with :

service mongod status

so this should start mongod:

service mongod start

so this should stop mongod:

sudo service mongod stop

It works at my end. for missing permissions:

sudo service mongod start
over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda