MongoDB2.6的配置文件详解

身居漏室,心系天下

下面是一个MongoDB2.6的配置文件的一个实例:


#where to log
logpath=/var/log/mongodb/mongod.log

logappend=true

# fork and run in background
fork=true

#port=27017

dbpath=/data/mongoddata

# location of pidfile
pidfilepath=/var/run/mongodb/mongod.pid

# Listen to local interface only. Comment out to listen on all interfaces.
bind_ip=127.0.0.1

# Disables write-ahead journaling
# nojournal=true

# Enables periodic logging of CPU utilization and I/O wait
#cpu=true

# Turn on/off security.  Off is currently the default
#noauth=true
#auth=true

# Verbose logging output.
#verbose=true

# Inspect all client data for validity on receipt (useful for
# developing drivers)
#objcheck=true


各个配置参数的解释如下:

说明:#在配置文件中代表注释符号,设置某个参数就去掉某个参数前面的#.

#where to log 日志保存位置或者说是目录
logpath=/var/log/mongodb/mongod.log 

logappend=true  #代表在原有日志文件基础上追加。


# fork and run in background  
fork=true #启用后台模式


#port=27017   #Mongod端口号


dbpath=/data/mongoddata  #数据库保存位置

# location of pidfile pidfile的本地保存位置
pidfilepath=/var/run/mongodb/mongod.pid

# Listen to local interface only. Comment out to listen on all interfaces.
bind_ip=127.0.0.1  #监听本地ip,可换成公网ip,这样从外网可以连接MongoDB.

# Disables write-ahead journaling 禁用预写日记
# nojournal=true 

# Enables periodic logging of CPU utilization and I/O wait 启动CPU利用率的定期记录和

I / O等待
#cpu=true

 

# Turn on/off security.  Off is currently the default 安全开关,默认为关闭
#noauth=true
#auth=true


# Verbose logging output. 详细的日志输出
#verbose=true

# Inspect all client data for validity on receipt (useful for
# developing drivers) 检查收到到所有的客户端数据的有效性(可用于各种开发)
#objcheck=true

京ICP备14008139号-1