I am Trying to implement sharding on our mongoDB data base , Here is the scenario
we have 1 server running config server
we have 2 servers running mongod instances called node1 and node2
We have 1 server running mongos
I have added the servers node1 and node2 as shard servers in the mongos shell by using the command
db.runCommand( { addshard : "serverhostname[:port]" } );
later I created database in node1 and enabled sharding for that database from Mongos
Now we have 2 shard servers and as per MongoDB documentation mongos should put some collections which are created node1 ( where the database actually resides ) and some collections on node 2 .
I created 300 collections from mongos but still all collections are going to only one server what is wrong in the above mentioned support
NOTE : - Since I am not in a position to upgrade the application layer I cant shard in collection level , I have a script which creates several collections dynamically for some requirement .
Please Provide your suggestions on how we can shard in database level so that collections gets equally distributed among all shard servers .
I am looking for some solution like
IF i create 300 collections automatically mongos should create around 150 or 100 collections in each of the two sharded servers .
Thanks in advance for stepping in and helping me fix this problem.