1

I would like to run mongodb on vagrant,I have used the following command:

 sudo mongod --fork --logpath /var/log/mongodb.log --dbpath ./data

I have also tried modifying the above statement with all(cumulatively) and each of these options:

--logappend
--journal
--port 27017 and --port 27018

I get this error(with request to add journaling for durability and a notification that mongod will copy log to temporary file if journaling or logappend are disabled):

forked process: 5360
all output going to: /var/log/mongodb.log
ERROR: child process failed, exited with error number 100

I already have mongodb installed on my pc and it uses 27017 as the port,will this conflict with the error in running mongod

vamsiampolu
  • 6,328
  • 19
  • 82
  • 183
  • You're using Ubuntu, why not start it as a service? Set the required parameters in the config file instead of from the command line, then `sudo service mongd start`. – SolarBear Oct 27 '14 at 18:20
  • @SolarBear how would I do the config file?`sudo service mongod start` says unrecognized service – vamsiampolu Oct 27 '14 at 18:24
  • 1
    Did you install it from the Ubuntu package? What Ubuntu version are you using? On 12.04 the service was named `mongodb` IIRC ; the more recent version is named `mongod`. – SolarBear Oct 27 '14 at 18:26
  • If you are actually running MongoDB using vagrant you will not get a port clash. But I don't see any vagrant in the snippets you have posted. Have you tried looking at the logs in /var/log/mongodb.log? – Saket Oct 27 '14 at 18:28
  • Also, check for other questions related to the exit code 100, there are various possible causes (eg. disk is full : http://stackoverflow.com/questions/25102414/unexpected-mongo-exit-code-100-restarting). – SolarBear Oct 27 '14 at 18:29
  • I can confirm that `mongodb` is running from `vagrant` when i use it with the service `mongodb` instead of `mongod` – vamsiampolu Oct 27 '14 at 18:32

0 Answers0