1. 程式人生 > >搭建Mongodb叢集:分片Sharding+副本集Replica Set 二

搭建Mongodb叢集:分片Sharding+副本集Replica Set 二

檔案配置:
1. mongodb0.cfg
port=27017
replSet=rs1
shardsvr=true
logpath=D:\mongodb\logs\r0.log
dbpath=D:\mongodb\db\r0
keyFile=D:\mongodb\key\keyfile

配置同上,注意埠和副本集名稱:mongodb1.cfg....mongodb8.cfg

2. config1.cfg
port=30000
configsvr=true
logpath=D:\mongodb\logs\config1.log
dbpath=D:\mongodb\db\config1
keyFile=D:\mongodb\key\keyfile

配置同上,注意埠:config2.cfg,config3.cfg

3.mongs1.cfg
port=40000
configdb=10.16.122.15:30000,10.16.122.15:30100,10.16.122.15:30200
logpath=D:\mongodb\logs\mongos1.log
keyFile=D:\mongodb\key\keyfile

配置同上,注意埠:mongs2.cfg,mongs3.cfg