title: Mongodb - how to restart mongodb that you just killed in Linux?
body: <p>How can I restart mongodb that I just killed in Linux?</p>
  
  <p>Before killing:</p>
  
  <pre><code>$ 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
  </code></pre>
  
  <p>So I wanted to stop/ kill it for a while for other programs:</p>
  
  <pre><code>$ 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)
  </code></pre>
  
  <p>But how can I start it again?</p>
  
  <p>I'm on Ubuntu <strong>16.04.</strong></p>
  
  <p><strong>EDIT:</strong></p>
  
  <pre><code>$ systemctl start mongod 
  Failed to start mongod.service: Unit mongod.service not found.
  </code></pre>
  
  <p><strong>EDIT 2:</strong></p>
  
  <pre><code>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)
  </code></pre>