搭建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

你可能感兴趣的:(mongodb)