## content 。 mongodb 日志开启并指定日志位置
systemLog:
destination: file
logAppend: true
path: /www/server/mongodb/log/config.log
# Where and how to store data. 指定数据库存在目录
storage:
dbPath: /www/server/mongodb/data
directoryPerDB: true
# 是否启用日志
journal:
enabled: true
# how the process runs。.指定跟踪进程文件夹路径,如果未指定,启动时会出现进程号
processManagement:
fork: true
pidFilePath: /www/server/mongodb/log/configsvr.pid
# network interfaces 配置ip及端口,外网访问
net:
port: 27017
bindIp: 0.0.0.0
#operationProfiling:
#搭建副本集统一名称配置
replication:
replSetName: mawen
#是否加密访问
security:
# authorization: enabled
authorization: disabled
javascriptEnabled: false
keyFile: /www/server/keyFile/mongodb.key
#keyFile 随便生成一个base64的文本即可,此文件如果在linux中那么这个文件不要赋予任何权限,否则启动时会报错:文件不安全
#sharding:
# clusterRole: shardsvr
#启动mongodb 并指定配置文件
#./mongod -f /www/server/mongodb27017/mongodb/config.conf
#初始化
#rs.initiate()
#副本集
# 向副本集中添加成员
#rs.ad
MongoDB 配置文件详解,以及副本集,优先级
最新推荐文章于 2024-05-16 11:19:23 发布