- 論壇徽章:
- 3
|
我的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掛掉了以后,就會發(fā)現無法整個集群就無法讀取和保存數據了,這是什么問題?請有經驗的大大指點下! |
|