Mongod --fork, ERROR: child process failed, exited with error number 14

I have encountered a problem while starting fork -
mongod --fork --logpath mongod.log
mongod --fork --logpath mongod.log --bind_ip


please help me.

Check which mongo processes are running and on which port:
ps -ef | grep "[m]ongo"

mongod 4114 1 1 15:30 ? 00:01:20 /usr/bin/mongod -f /etc/mongod.conf


Have a look in the /etc/mongod.conf config file and see which host and port it’s running on.

network interfaces

port: 27017
bindIp: # Enter,:: to bind to all IPv4 and IPv6 addresses or, alternatively, use the net.bindIpAll setting.

[vagrant@m042 etc]$ cat hostname

That means that you are already running a mongod process on port 27017.
If you don’t specify a port, it will default to 27017.

What can be the problem here?
how am i not able to start deamon process?
Can it be permission issue for that file?

I actually explained the problem in my last message.

The mongod process is already running. Login using mongo:
mongo --host localhost:27017

1 Like

I am not able to connect from host machine to mongodb.
D:\Tutorials\MongoDB\M042\m042-vagrant-env>mongo --host
MongoDB shell version v4.2.0
connecting to: mongodb://
2019-10-08T22:27:34.787+0530 E QUERY [js] Error: couldn’t connect to server, connection attempt failed: SocketException: Error connecting to :: caused by :: No connection could be made because the target machine actively refused it. :
2019-10-08T22:27:34.791+0530 F - [main] exception: connect failed
2019-10-08T22:27:34.791+0530 E - [main] exiting with code 1

Now its working by changing the ip address to localhost
D:\Tutorials\MongoDB\M042\m042-vagrant-env>mongo --host localhost:27017
MongoDB shell version v4.2.0
connecting to: mongodb://localhost:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { “id” : UUID(“2782df53-c052-40ca-bfa0-4d245b2cf70e”) }
MongoDB server version: 4.2.0
Server has startup warnings:
2019-10-08T18:55:10.183+0530 I CONTROL [initandlisten]
2019-10-08T18:55:10.183+0530 I CONTROL [initandlisten] ** WARNING: Access control is not enabled for the database.
2019-10-08T18:55:10.183+0530 I CONTROL [initandlisten] ** Read and write access to data and configuration is unrestricted.
2019-10-08T18:55:10.210+0530 I CONTROL [initandlisten]
MongoDB Enterprise >


Does this cmd-
mongod --fork --logpath mongod.log --bind_ip
not binding the mongodb to this IP?

To understand more, I suggest you take the M103: Basic Cluster Administration course.

I’m taking the 103 course, the problem exists on their IDE. when I run the command mongod --fork --logpath /path/to/file it throws the error after forking processes. If you run it without fork, as it suggests, it throw another error saying that the mongod.log file exists. If I then run rm /…/mongod.log and ls the directory to show the file is gone, then run all the commands again it just repeats.

Please share a screenshot of the whole IDE that shows how you run the command and the errors you are having.

Specify which lab you are doing.

This thread is for M042. Please start a new thread with your screenshot and make sure it is associated to the appropriate course.

In addition, this thread dates all the way back to 2019 so please be mindful of resurrecting old threads.

So you came out of the wood-work to say something that is completely meaningless?