免费注册 查看新帖 |

Chinaunix

  平台 论坛 博客 文库
最近访问板块 发新帖
查看: 49152 | 回复: 0
打印 上一主题 下一主题

[MongoDB] 复制集的问题 [复制链接]

论坛徽章:
3
2015亚冠之卡尔希纳萨夫
日期:2015-08-04 19:46:43数据库技术版块每日发帖之星
日期:2015-08-07 06:20:00数据库技术版块每日发帖之星
日期:2016-08-15 06:20:00
跳转到指定楼层
1 [收藏(0)] [报告]
发表于 2017-07-30 07:43 |只看该作者 |倒序浏览
我的Mongodb集群设置:
primary---second--arbit
primary上设置了两个分片  second上也设置了两个分片
shard0001.conf
logpath=/home/bdxiaodai/test-mongodb/log/shard0001.log
logappend=true
fork=true
port=51002
oplogSize=1
shardsvr=true
replSet=rs1
wiredTigerCacheSizeGB=1
dbpath=/home/bdxiaodai/test-mongodb/data/shard0001
pidfilepath=/home/bdxiaodai/test-mongodb/pid/shard0001.pid

shard0002.conf
logpath=/home/bdxiaodai/test-mongodb/log/shard0002.log
logappend=true
fork=true
port=51003
oplogSize=1
shardsvr=true
replSet=rs2
wiredTigerCacheSizeGB=1
dbpath=/home/bdxiaodai/test-mongodb/data/shard0002
pidfilepath=/home/bdxiaodai/test-mongodb/pid/shard0002.pid

在这3台服务器上都设置了config 和mongos
configsvr.conf
logpath=/home/bdxiaodai/test-mongodb/log/configsvr.log
logappend=true
fork=true
port=51001
configsvr=true
replSet=rsconfig
dbpath=/home/bdxiaodai/test-mongodb/data/configsvr
pidfilepath=/home/bdxiaodai/test-mongodb/pid/configsvr.pid

mongos.conf
logpath=/home/bdxiaodai/test-mongodb/log/mongos.log
logappend=true
fork=true
port=51000
pidfilepath=/home/bdxiaodai/test-mongodb/pid/mongos.pid
configdb=rsconfig/192.168.99.83:51001,192.168.99.85:51001,192.168.99.84:51001


arbit
ab1.conf
logpath=/home/bdxiaodai/test-mongodb/log/ab1.log
logappend=true
fork=true
port=51002
oplogSize=1
dbpath=/home/bdxiaodai/test-mongodb/data/ab1
pidfilepath=/home/bdxiaodai/test-mongodb/pid/ab1.pid
#shardsvr=true
replSet=rs1

ab2.conf
logpath=/home/bdxiaodai/test-mongodb/log/ab2.log
logappend=true
fork=true
port=51003
oplogSize=1
dbpath=/home/bdxiaodai/test-mongodb/data/ab2
pidfilepath=/home/bdxiaodai/test-mongodb/pid/ab2.pid
#shardsvr=true
replSet=rs2

3台服务器能正常复制
但是当primary挂掉了以后,就会发现无法整个集群就无法读取和保存数据了,这是什么问题?请有经验的大大指点下!
您需要登录后才可以回帖 登录 | 注册

本版积分规则 发表回复

  

北京盛拓优讯信息技术有限公司. 版权所有 京ICP备16024965号-6 北京市公安局海淀分局网监中心备案编号:11010802020122 niuxiaotong@pcpop.com 17352615567
未成年举报专区
中国互联网协会会员  联系我们:huangweiwei@itpub.net
感谢所有关心和支持过ChinaUnix的朋友们 转载本站内容请注明原作者名及出处

清除 Cookies - ChinaUnix - Archiver - WAP - TOP