1. Shard Server Settings
Mongod-port 10001-dbpath=f:/dbsoft/mongodb/rs_data/master-directoryperdb--shardsvr-replset RetA--rest--oplogSize 64
Mongod-port 10002-dbpath=f:/dbsoft/mongodb/rs_data/slaver-directoryperdb--shardsvr-replset RetA--rest--oplogSize 64
Mongod-port 10003-dbpath=f:/dbsoft/mongodb/rs_data/arbiter-directoryperdb--shardsvr-replset RetA--rest-- Oplogsize 64
2. Initialization
D:/mongodb-win32-i386-1.8.0/bin>call Mongo.exe 127.0.0.1:10000/admin
MongoDB Shell version:1.8.0
Connecting To:127.0.0.1:10000/admin
> config={_id: "Reta", members:[{"_id": 0,host: "127.0.0.1:10001"},{"_id": 1,host: "127.0.0.1:10002"},{"_id": 2, Host: "127.0.0.1:10003"}]}
{"_id":"setA","members":[{"_id":0,"host":"127.0.0.1:10000"},{"_id":1,"host":"127.0.0.1:10001"},{"_id":2,"host": "127.0.0.1:10002"}]}
setA> rs.initiate(config);
3. Configure Server Settings
Mongod-configsvr-port 20001-dbpath=f:/dbsoft/mongodb/rs_data/set1
4. Routing Server settings
MONGOs--configdb 127.0.0.1:10001,127.0.0.1:10002,127.0.0.1:10003--port 27017
5. Setting up Shards
>mongo 127.0.0.1:30001/admin
> Db.runcommand ({addshard: "seta/127.0.0.1:10001,127.0.0.1:10002,127.0.0.1:10003", Name: "Shardseta"})
6. If you need to set up multiple shards
Repeat steps.
MongoDB Shard Configuration under Windows