Mongdb 3.2 复制集配置 官方默认配置 启用认证 Windows环境

步骤:

1、更新hosts文件

路径:C:\Windows\System32\drivers\etc

在hosts文件里添加:

xxx.xxx.xxx.xxx    mongodb0.example.net
xxx.xxx.xxx.xxx    mongodb1.example.net
xxx.xxx.xxx.xxx    mongodb2.example.net


2、添加文件夹

路径:D:\MongoDB\data

添加3个文件夹db26001,db26002,db26003


3、生成keyfile文件

linux环境:
openssl rand -base64 756 > aaakeyfile1.dat
chmod 400 aaakeyfile1.dat

//文件需要转换格式,从Unix到Windows格式


4、准备config文件

路径:D:\MongoDB\Server\3.2\bin

文件名:mongodb26001.conf

内容:

port=26001
logpath=D:\MongoDB\data\db26001\mongod26001.log
logappend=true
pidfilepath=D:\MongoDB\data\db26001\26001.pid  
dbpath=D:\MongoDB\data\db26001
#bind_ip=mongodb0.example.net
maxConns=500
replSet=rs0
#auth=true
#keyFile=D:\MongoDB\Server\3.2\bin\aaakeyfile1.dat

#fork=true
#cpu=true
#noauth=true

//相应配置mongodb26002.conf,mongodb26003.conf


5、启动mongod

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值