MongoDB Documentation, Release 3.0.4 Note: If chunk migrations are in progress while creating a hashed shard key collection, the initial chunk distribution may be uneven until the balancer automatically balances the collection. To shard a collection using a hashed shard key, use an operation in the mongo that resembles the following: This operation shards the active collection in the records database, using a hash of the a field as the shard key. Shard the Collection Specify the Initial Number of Chunks If you shard an empty collection using a hashed shard key, MongoDB automatically creates and migrates empty chunks so that each shard has two chunks. To control how many chunks MongoDB creates when sharding the collection, use shardCollection with the numInitialChunks parameter. Important: MongoDB 2.4 adds support for hashed shard keys. After sharding a collection with a hashed shard key, you must use the MongoDB 2.4 or higher mongos and mongod instances in your sharded cluster. Warning: MongoDB hashed indexes truncate floating point numbers to 64-bit integers before hashing. For example, a hashed index would store the same value for a field that held a value of 2.3 , 2.2 , and 2.9 . To prevent collisions, do not use a hashed index for floating point numbers that cannot be reliably converted to 64-bit integers (and then back to floating point). MongoDB hashed indexes do not support floating point values larger than 2$^{53}$. You add shards to a sharded cluster after you create the cluster or any time that you need to add capacity to the cluster. If you have not created a sharded cluster, see Deploy a Sharded Cluster (page 691). In production environments, all shards should be replica sets . Balancing When you add a shard to a sharded cluster, you affect the balance of chunks among the shards of a cluster for all existing sharded collections. The balancer will begin migrating chunks so that the cluster will achieve balance. See Sharded Collection Balancing (page 684) for more information. Changed in version 2.6: Chunk migrations can have an impact on disk space. Starting in MongoDB 2.6, the source shard automatically archives the migrated documents by default. For details, see moveChunk directory (page 687). Capacity Planning When adding a shard to a cluster, always ensure that the cluster has enough capacity to support the migration required for balancing the cluster without affecting legitimate production traffic. 697 10.3. Sharded Cluster Tutorials Add Shards to a Cluster Considerations sh.shardCollection( "records.active", { a: "hashed" } )