title: Mongodb not sharding
body: <p>We have attempted to shard a large collection in mongodb 2.4.9 across 3 replica sets (rs1, rs2, rs3). At present, all data resides on rs1.</p>
  
  <p>We have 3 config servers running and enabled sharding using:</p>
  
  <pre><code>sh.enableSharding("test")
  </code></pre>
  
  <p>We then selected a shard key and sharded a collection:</p>
  
  <pre><code>sh.shardCollection("test.fs.chunks", { files_id : 1 , n : 1 } )   
  </code></pre>
  
  <p>After that we added our additional shards:</p>
  
  <pre><code>sh.addShard( "rs2/mongo2:27017" )
  
  sh.addShard( "rs3/mongo3:27017" )
  </code></pre>
  
  <p>However - after 4 days, all data still resides on rs1. Looking at the configuration, the database we are sharding is listed as "partitioned = true":</p>
  
  <pre><code>{  "_id" : "test",  "partitioned" : true,  "primary" : "rs1" }
  </code></pre>
  
  <p>However, when we execute db.fs.chunks.getShardDistribution() we are presented with an error stating that the collection is not sharded:</p>
  
  <pre><code>mongos&gt; db.fs.chunks.getShardDistribution()
  Collection test.fs.chunks is not sharded.
  </code></pre>
  
  <p>We then tried to re-execute the shardCollection command and receive an error stating that it is already sharded:</p>
  
  <pre><code>mongos&gt; sh.shardCollection("test.fs.chunks", { files_id : 1 , n : 1 } )
  
  "code" : 13449,
  
  "ok" : 0,
  
  "errmsg" : "exception: collection test.fs.chunks already sharded with 33463 chunks"
  </code></pre>
  
  <p>All 3 config servers are operational. The mongos logs contain a series of balancer distributed lock acquired / unlocked messages but nothing else noteworthy.</p>
  
  <p>Does anyone have any advice on how we can troubleshoot this further and get some sharding happening?</p>
  
  <p>Thanks</p>
  
  <p>Dave</p>