Cannot start mongo server

mongod -f mongod-repl-1.conf
about to fork child process, waiting until server is ready for connections.
forked process: 9619

ERROR: child process failed, exited with error number 51

Welcome @xueyongfei01!

You have two debugging options:

  • Comment out fork: true in your config file and run mongod again
  • Have a look in the log file

That way you can see what the actual error message is.

vagrant@m103:~$ cat mongod-repl-1.conf
storage:
dbPath: /var/mongodb/db/rcs1
net:
bindIp: 192.168.103.100,localhost
port: 27001
security:
authorization: enabled
keyFile: /var/mongodb/pki/m103-keyfile
systemLog:
destination: file
path: /var/mongodb/db/mongod1.log
logAppend: true
processManagement:
fork: true
replication:
replSetName: m103-repl

this is my config
thanks

Hi there,
I got mongod -f mongod-repl-1.conf
Aborted (core dumped)

2019-11-28T18:09:19.186+0000 I STORAGE [initandlisten] exception in initAndListen: NonExistentPath: Data directory /var/mongodb/db/rcs2 not found., terminating
2019-11-28T18:09:19.186+0000 F - [initandlisten] Invariant failure globalStorageEngine src/mongo/db/service_context.cpp 96

I created the rcs1 folder and it works~
thanks a lot

This is the problem. It was discussed somewhere in the lectures too.

Ah very good! You found it just before I posted! :beers:

Hi @xueyongfei01,

I’m glad your issue got resolved. If you have any other query then please feel free to get back to us.

Happy Learning :slight_smile:

Thanks,
Shubham Ranjan
Curriculum Support Engineer

@Shubham_Ranjan I am facing the same problem with error number 51.

mongod -f /data/mongod.conf

systemLog:
destination: file
path: “/var/log/mongodb/mongod.log”
logAppend: true

storage:
dbPath: “/var/mongodb/db”
journal:
enabled: true

processManagement:
fork: true

net:
bindIp: 127.0.0.1,192.168.103.100
port: 27000

setParameter:
enableLocalhostAuthBypass: false

security:
authorization: enabled

command: mongod --port 27000 --dbpath /var/mongodb/db --logpath /var/log/mongodb/mongol.log --bind_ip 127.0.0.1,192.168.103.100 --fork

Please make sure your dbpath/logpath dirs exist with proper permissions
Also check your mongod.log

1 Like