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 192.168.42.100

image

please help me.
Thanks.

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

image

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

network interfaces

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

[vagrant@m042 etc]$ cat hostname
m042.university.mongodb

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 192.168.42.100:27017
MongoDB shell version v4.2.0
connecting to: mongodb://192.168.42.100:27017/?compressors=disabled&gssapiServiceName=mongodb
2019-10-08T22:27:34.787+0530 E QUERY [js] Error: couldn’t connect to server 192.168.42.100:27017, connection attempt failed: SocketException: Error connecting to 192.168.42.100:27017 :: caused by :: No connection could be made because the target machine actively refused it. :
connect@src/mongo/shell/mongo.js:341:17
@(connect):2:6
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 >

Thanks

Does this cmd-
mongod --fork --logpath mongod.log --bind_ip 192.168.42.100
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.

@Jesse_Richey,
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?