Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

mongodb - Starting mongod fork, ERROR: child process failed, exited with error number 1

In attempting to run the command

mongod --fork --logpath /var/log/mongodb.log

On a amazon ec2 32 bit instance (Amazon Linux AMI release 2014.09), I run into the following error:

2015-02-18T18:14:09.007+0000 
2015-02-18T18:14:09.007+0000 warning: 32-bit servers don't have journaling    
enabled by default. Please use --journal if you want durability.
2015-02-18T18:14:09.007+0000 
about to fork child process, waiting until server is ready for connections.
forked process: 17116
ERROR: child process failed, exited with error number 1

I also notice no log file is created in the process.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

I had the same thing and it turned out to be a permissions issue. If the owner of the child process cannot access the log path or the log path does not exist, it will fail.

What I did was put the log directory in my home directory:

mkdir ~/log
mongod --fork --logpath ~/log/mongodb.log

If you really want to put it in your /var/log directory, just change the permissions.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...