ipx-spx 发表于 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挂掉了以后,就会发现无法整个集群就无法读取和保存数据了,这是什么问题?请有经验的大大指点下!
页: [1]
查看完整版本: 复制集的问题