Question

I'm installing MongoDB on OS X, using the 10gen builds.
But their installation tutorial proves to be a bit scarce for me.

So far I've found examples of mongod installed as a launch agent and as a launch daemon. Based on my understanding of launch daemons vs. launch agents, what approach is best / the sufficient minimum?

Does mongod need to display information through the window server, so it's best to configure the service as a launch agent or is it enough to make it a launch daemon?

Was it helpful?

Solution

First launch daemon versus launch agent: mongod does not need to display information though the window server, so how you do this will depend more your use case. If you intend to run mongod as a server on this host permanently, then daemon is the best choice. If you are using it more as a developer and hitting it for local dev work, then agent is appropriate but daemon will also work. Hence, if in doubt, go for the daemon approach.

In most cases, people develop against MongoDB on the Mac, deploy on Linux, hence the mix of recommendations you have found. If people were deploying to prod on Mac more often it would be far more skewed toward daemon.

For proof of this, consider the defaults when a mongod starts on OS X versus Linux. On OS X, mongod will start with the smallfiles option by default and will allocate a small oplog (~256MB) when running as a replica set member - all things you would do for a test system. For Linux, it will run without the smallfiles option and will allocate 5% of free space for the oplog by default.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top