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
Similar issue with the same error - I was trying to run the repair script
sudo -u mongodb mongod -f /etc/mongodb.conf --repair
Checked ps aux | grep mongo
and see that the daemon was running. Stopped it and then the repair script run without an issue.
Hope that could be helpful for someone else.
create folder "data" and "db" inside it, in "/" path of your server. actually you should create or modify permissions of folder that the data is going to be stored!
I had the same error. I ran it interactively to see the log.
2014-10-21T10:12:35.418-0400 [initandlisten] ERROR: listen(): bind() failed errno:48 Address already in use for socket: 0.0.0.0:27017
Then I used lsof
to find out which process was using my port.
$ lsof -i:27017
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
mongod 2106 MYUSERID 10u IPv4 0x635b71ec3b65b4a1 0t0 TCP *:27017 (LISTEN)
It was a mongod
that I had forked previously and forgot to turn off (since I hadn't seen it running in my bash window).
Simply killing it by running kill 2106
, enabled my process to run without the error 100.
Generally, this error comes when the mongod.conf file is not able to find a certain path for Database store or log store or maybe processid store or maybe it's not getting the file permission to access the config directories and files which has been declared in mongod.conf
to resolve this error we need to observe the log generated by the MongoDB it will clearly indicate whether which file or directory you MongoDB is not able to access
the above error may look like below screenshot
I had the same error on linux (Centos) and this worked for me
Remove mongod.lock from the dbpath
$ rm /var/lib/mongo/mongod.lock
Repair the mongod process
$ mongod --repair
Run mongod config
$ mongod --config /etc/mongod.conf
There was the same problem on my machine. In the log file was:
Mon Jul 29 09:57:13.689 [initandlisten] ERROR: Insufficient free space for journal file
Mon Jul 29 09:57:13.689 [initandlisten] Please make at least 3379MB available in /var/mongoexp/rs2/journal or use --smallfiles
It was solved by using mongod --smallfiles
. Or if you start mongod with --config option than in a configuration file disable write-ahead journaling by nojournal=true
(remove the beginning #). Some more disk space would also solve the above problem.