I have edited the question.
I was trying to run the sh.splitAt
mongos> sh.splitAt("test.zp",{"city": "1"})it worked.
But the problem is at sharding chunks.
when i have run the command sh.status().
It shows like this
databases:
{ "_id" : "admin", "partitioned" : false, "primary" : "config" }
{ "_id" : "test", "partitioned" : true, "primary" : "shard0000" }
test.zp
shard key: { "city" : 1 }
chunks:shard0000 34
too many chunks to print, use verbose if you want to force print.
i have three more shards but with different ip's.why sharding is not applied to the secondary shards. I have shards like
{ "_id" : "shard0000", }
{ "_id" : "shard0001", }
{ "_id" : "shard0002", }
{ "_id" : "shard0003", }
How chunks will be added to "shard0001" and remaining shards.I have added all shards to the test db. and my data is 1.2GB.
Best Answer
You need to enable sharding on the database test first:
Then you need to shard the collection and pick a shard key. Based on what you were trying to split on, that would be:
A couple of notes: