如何为MongoDB创建配置文件 [英] How to Create a configuration File For MongoDB
问题描述
我已经通过10gen为mac os安装了mongodb,并且已经阅读了文档.除了配置文件外,其他一切似乎都还不错.我在/etc/mongod.config中看不到它.我是否必须手动创建此配置文件?如果是这样,我该怎么做?
I have installed mongodb for mac os through 10gen and I have gone through the documentation to do so. Everything seems fine apart from the configuration file. I can not see it in /etc/mongod.config. Do I have to manually create this config file? And if so how can I go about it?
欢呼
推荐答案
除非您已安装MongoDB的打包版本(例如,使用启动MongoDB时的命令行参数.
Unless you have installed a packaged version of MongoDB (for example, using Homebrew or Mac Ports) you will have to create a config file manually, or just pass the appropriate command line parameters when starting up MongoDB.
If you want a commented example of a config file to start with, the mongodb.conf in the Debian/Ubuntu package should be a good starting point. Important options to check are the dbpath
and logpath
which will likely be different for you.
值得一提的是 Homebrew mongodb公式,其中包括设置LaunchAgent脚本来管理mongod服务.
It would also be worth looking at the Homebrew mongodb formula which includes setting up a LaunchAgent script to manage the mongod service.
这篇关于如何为MongoDB创建配置文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!