mongo server setup are following
Config server 1
./mongod --bind_ip 192.168.50.75 --port 30000 --dbpath /sata1/configdb --configsvr --quiet --logpath /usr/local/ct/depend/mongo/logs/mongod_30000.log --logappend --journalCommitInterval 2
Shard server: there are two shard server , we generate 1 to 10. shard keys ,1 to 5 shard keys will go shard1 and 6 to 10 shard keys will go shard2.
shard1: ./mongod --bind_ip 192.168.50.75 --port 20000 --dbpath /sata1/master --shardsvr --quiet --logpath /usr/local/ct/depend/mongo/logs/mongod_20000.log --logappend --journalCommitInterval 2
shard2:./mongod --bind_ip 192.168.50.75 --port 25000 --dbpath /sata2/master --shardsvr --quiet --logpath /usr/local/ct/depend/mongo/logs/mongod_25000.log --logappend --journalCommitInterval 2
mongos 1
./mongos --bind_ip 192.168.50.75 --port 35000 --configdb 192.168.50.75:30000 --quiet --logpath /usr/local/ct/depend/mongo/logs/mongos_35000.log --logappend
now connect to mongos
./mongo 192.168.50.75:35000
at run time i will stop shard2
and apply
mongos> db.Database.insert({_sk:2})
Wed Dec 28 20:22:19 uncaught exception: error
mongos> db.Database.insert({_sk:7})
socket exception
i got exception on for _sk:7 , its ok but got exception for _sk:2 which not ok because shard key 2 will go shard1 which is runnig.
Regars
Jitendra Verma