MongoDB 配置文件详解,以及副本集,优先级

## 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
  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值