如何为MongoDB创建配置文件 [英] How to Create a configuration File For MongoDB

查看:501
本文介绍了如何为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的打包版本(例如,使用

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆