Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

491
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!