http://blog.csdn.net/sxb0841901116/article/details/40923841
cd D:\Program Files\MongoDB\Server\3.4\bin
如下命令启动两个副本集:
mongod --shardsvr --replSet shard-a --dbpath "D:\data\db\rs-a-1" --port 3000 --logpath "D:\data\log\rs-a-1.log" --nojournal
mongod --shardsvr --replSet shard-a --dbpath "D:\data\db\rs-a-2" --port 3001 --logpath "D:\data\log\rs-a-2.log" --nojournal
mongod --shardsvr --replSet shard-a --dbpath "D:\data\db\rs-a-3" --port 3002 --logpath "D:\data\log\rs-a-3.log" --nojournal
mongod --shardsvr --replSet shard-b --dbpath "D:\data\db\rs-b-1" --port 30100 --logpath "D:\data\log\rs-b-1.log" --nojournal
mongod --shardsvr --replSet shard-b --dbpath "D:\data\db\rs-b-2" --port 30101 --logpath "D:\data\log\rs-b-2.log" --nojournal
mongod --shardsvr --replSet shard-b --dbpath "D:\data\db\rs-b-3" --port 30102 --logpath "D:\data\log\rs-b-3.log" --nojournal
用如下命令启动配置服务器
mongod --configsvr --dbpath "D:\data\db\config-1" --port 27019 --logpath "D:\data\log\config-1.log"
mongod --configsvr --dbpath "D:\data\db\config-2" --port 27020 --logpath "D:\data\log\config-2.log"
mongod --configsvr --dbpath "D:\data\db\config-3" --port 27021 --logpath "D:\data\log\config-3.log"