0

I am trying to setup mongodb as a service.

service mongod status
   mongod.service - High-performance, schema-free document-oriented database
   Loaded: loaded (/etc/systemd/system/mongod.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Mon 2019-01-21 10:17:13 IST; 2s ago
     Docs: https://docs.mongodb.org/manual
  Process: 13220 ExecStart=/bin/bash /home/idt/bin/mongod --config /etc/mongod.conf (code=exited, status=127)
 Main PID: 13220 (code=exited, status=127)

The mongod.conf file is as follows

        cat /etc/mongod.conf
    # mongod.conf

    # for documentation of all options, see:
    #   http://docs.mongodb.org/manual/reference/configuration-options/

    # Where and how to store data.
    systemLog:
       destination: file
       path: /var/log/mongodb/mongod.log
       logAppend: true
    storage:
       dbPath: /data/db
       journal:
          enabled: true
    processManagement:
       fork: true
    net:
       bindIp: 127.0.0.1
       port: 27017
    setParameter:
       enableLocalhostAuthBypass: false


=======
1

1 Answer 1

0

The error 127 in bash means the command is not found. Be sure the package mongod package is installed. Don't be confused as Ubuntu provides mongodb package while official website provides mongod. Here how you can check your system sanity:

List what is now installed on your system

dpkg -l | grep mongod

So check if you are effectively using mongod or mongodb. You should check the package mongod(b)-server which is the server side. In case of you only have mongod(b) or mongod(b)-client package installed, you might try to install the server again.

sudo apt install mongod(b)-server

Then you should able to restart your daemon

sudo service mongod(b) start

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .