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.