When I start the MongoDB server (mongod) from terminal it keeps that tab open. How do I go about running it as a service?
I'm on OSX Lion.
I like how the rails server script has a -d option to detach it from terminal.
To start MongoDB, run mongod.exe from the Command Prompt navigate to your MongoDB Bin folder and run mongod command, it will start MongoDB main process and The waiting for connections message in the console.
Open up your command prompt and type mongod to start the MongoDB server.
This is built into mongod
, much like it is in the rails server. Instead of -d
you'll need to use --fork
and you'll probably want to specify --logpath /path-to/logfile --logappend
as well, so that your output will be logged and will keep any previous logs.
See the docs on starting and stopping Mongo for more information.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With