简体   繁体   English

配置mongod服务:启动守护程序还是启动代理?

[英]Configuring the mongod service: launch daemon or launch agent?

I'm installing MongoDB on OS X, using the 10gen builds. 我正在使用10gen版本在OS X上安装MongoDB。
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 . 到目前为止,我已经找到了安装mongod作为启动代理启动守护程序的示例。 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? mongod是否需要通过窗口服务器显示信息,因此最好将服务配置为启动代理,还是足以使其成为启动守护程序?

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. 首次启动守护程序与启动代理: mongod不需要通过窗口服务器显示信息,因此如何执行将取决于您的用例。 If you intend to run mongod as a server on this host permanently, then daemon is the best choice. 如果打算将mongod永久作为此主机上的服务器运行,则守护程序是最佳选择。 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. 在大多数情况下,人们在Mac上针对MongoDB进行开发,在Linux上进行部署,因此您会发现各种建议。 If people were deploying to prod on Mac more often it would be far more skewed toward daemon. 如果人们更频繁地在Mac上部署产品,它将更加倾向于守护程序。

For proof of this, consider the defaults when a mongod starts on OS X versus Linux. 为了证明这一点,请考虑在OS X与Linux上启动mongod时的默认设置。 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. 在OS X上, mongod默认情况下将以smallfiles选项开头,并且在以副本集成员身份运行时将分配一个小的操作日志(〜256MB)-您将为测试系统执行的所有操作。 For Linux, it will run without the smallfiles option and will allocate 5% of free space for the oplog by default. 对于Linux,它将在不使用smallfiles选项的情况下运行,并且默认情况下将为操作日志分配5%的可用空间。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM