mongoDB分布式部署(windows)——环境准备——本机(一)

  1. 操作系统
    windows10
  2. mongodb版本
    3.4.X
  3. mongo安装路径
    D:\mongo
  4. 建立服务器本地路径
    D:\mongo\shard11\data
    D:\mongo\shard12\data
    D:\mongo\shard13\data
    D:\mongo\shard11\log\shard11.log
    D:\mongo\shard12\log\shard12.log
    D:\mongo\shard13\log\shard13.log
    D:\mongo\shard11\shard11.conf
    D:\mongo\shard12\shard12.conf
    D:\mongo\shard13\shard13.conf

    D:\mongo\shard21\data
    D:\mongo\shard22\data
    D:\mongo\shard23\data
    D:\mongo\shard21\log\shard21.log
    D:\mongo\shard22\log\shard22.log
    D:\mongo\shard23\log\shard23.log
    D:\mongo\shard21\shard21.conf
    D:\mongo\shard22\shard22conf
    D:\mongo\shard23\shard23conf

    D:\mongo\config\data
    D:\mongo\config\log\config.log
    D:\mongo\config\config.conf

    D:\mongo\route\data
    D:\mongo\route\log\route.log
    D:\mongo\route\route.conf

  5. 服务器配置文件示例(组成副本集)

    配置文件名称副本集名称(replica set)bind_ip端口服务器预设类型可配置数量
    shard11.confrs10.0.0.010001主服务器1
    shard12.confrs10.0.0.010002从服务器1+
    shard13.confrs10.0.0.010003仲裁服务器1
    shard21.confrs20.0.0.020001主服务器1
    shard22.confrs20.0.0.020002从服务器1+
    shard23.confrs20.0.0.020003仲裁服务器1
    config.confconf0.0.0.030000配置服务器1+
    route.conf不建立副本集0.0.0.040000路由服务器1+

    分片服务器配置示例:

dbpath = D:\mongo\shard11\data   
port = 10011
auth = false
bind_ip = 0.0.0.0
directoryperdb = true
logpath = D:\mongo\shard11\log\shard11.log
shardsvr=true
replSet=set1
oplogSize=2048

配置服务器配置示例:

dbpath = D:\mongo\config\data
port = 30000
auth = false
bind_ip=0.0.0.0
directoryperdb = true
logpath = D:\mongo\config\log\config.log
configsvr=true
oplogSize=2048
replSet=conf

路由服务器示例:

port = 40000
logpath = D:\mongo\route\log\route.log
configdb=conf/127.0.0.1:30000
注:configdb属性务必于配置服务器对应  配置服务器副本集名称(replSet)/ip地址:端口
这里区别于生产配置,生产配置的时候,是不允许出现本地ip地址,即:127.0.0.1和localhost

注意以下问题:
auth=false
oplogsize表示日志文件的大小,根据需要做限制
mongodb在3.2版本及以上要求必须建立副本集

mongoDB分布式部署(二)>>

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值