MongoDB Sharding

45 views
Skip to first unread message

Abhimanyu B

unread,
May 6, 2016, 1:33:22 AM5/6/16
to mongodb-user
Hi,

I have implemented sharding for two collections based on a column which is not indexed. Now after checking sh.status(), I can see all the data is saving in primary shard only. Data is not distributing among the other shard servers. What to do?

William Hagan

unread,
May 8, 2016, 7:50:54 PM5/8/16
to mongodb-user
Hi,

Have you  enabled sharding at the database level and also called "sh.shardCollection"?

Rhys Campbell

unread,
May 10, 2016, 1:09:27 AM5/10/16
to mongodb-user
Pretty sure you can only shard on index fields...


"To shard a collection, you need to select a shard key. A shard key is either an indexed field or an indexed compound field that exists in every document in the collection."

Check the output of sh.status()


Reply all
Reply to author
Forward
0 new messages