Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

install mongoDB (child process failed, exited with error number 100)

I tried to install mongoDB on my macbook air.

I've downloaded zipped file from official website and extract that file and move to root directory. After that, under that directory, I've made /data/db and /log folder.

Here is my mongodb.config which describes the basic config for my DB.

dbpath = /mongodb/data/db logpath = /mongodb/log/mongo.log logappend = true #bind ip = 127.0.0.1 port = 27017  fork = true rest = true verbose = true #auth = true #noauth = true 

Additionally, I want to know what the # means in the config file.

I put this file to /mongodb/bin, /mongodb is the directory I extracted the files into.

I opened terminal and entered ./mongod --config mongodb.config and I got this back.

Juneyoung-ui-MacBook-Air:bin juneyoungoh$ ./mongod --config mongodb.config about to fork child process, waiting until server is ready for connections. forked process: 1775 all output going to: /mongodb/log/mongo.log ERROR: child process failed, exited with error number 100 

How can I handle this error and what this means?

like image 973
Juneyoung Oh Avatar asked Apr 12 '13 04:04

Juneyoung Oh


2 Answers

The data folders you created were very likely created with sudo, yes? They are owned by root and are not writable by your normal user. If you are the only user of your macbook, then change the ownership of the directories to you:

sudo chown juneyoungoh /data sudo chown juneyoungoh /data/db sudo chown juneyoungoh /data/log 

If you plan on installing this on a public machine or somewhere legit, then read more about mongo security practices elsewhere. I'll just get you running on your macbook.

like image 60
Joe Frambach Avatar answered Oct 01 '22 07:10

Joe Frambach


I had a similar issue and it was not related to any 'sudo' problem. I was trying to recover from a kernel panic!

When I look at my data folder I found out a mongod.lock file was there. In my case this page helped a lot: http://docs.mongodb.org/manual/tutorial/recover-data-following-unexpected-shutdown/. As they explain,

if the mongod.lock is not a zero-byte file, then mongod will refuse to start.

I tested this solution in my environment and it works perfectly:

  1. Remove mongod.lock file.
  2. Repair the database: mongod --dbpath /your/db/path --repair
  3. Run mongod: mongod --dbpath /your/db/path
like image 45
goldenboy Avatar answered Oct 01 '22 07:10

goldenboy