Re: Node still contains all records after sharding

29 views
Skip to first unread message

andre.defrere

unread,
Aug 28, 2012, 4:39:38 PM8/28/12
to mongod...@googlegroups.com
Hi Naslund,

Could you post the results of a sh.status() run from your mongos?

Regards,
André

On Wednesday, August 29, 2012 6:26:27 AM UTC+10, Naslund wrote:
I followed the tutorial below to set up sharding. My initial node contained ~10k records once sharding was done the secondary node contained ~5k records however the first node still contains all of the records. I'm not sure what I missed, can anyone shed some light on this.

http://docs.mongodb.org/manual/tutorial/convert-replica-set-to-replicated-shard-cluster/

Naslund

unread,
Aug 28, 2012, 4:43:05 PM8/28/12
to mongod...@googlegroups.com
 sharding version: { "_id" : 1, "version" : 3 }
  shards:
        {  "_id" : "rs0",  "host" : "rs0/1.2.3.4:27018,1.2.3.4:27019,Hadoop01-dev:27017" }
        {  "_id" : "rs1",  "host" : "rs1/1.2.3.5:27018,1.2.3.5:27019,Hadoop02-dev:27017" }
  databases:
        {  "_id" : "admin",  "partitioned" : false,  "primary" : "config" }
        {  "_id" : "mydb",  "partitioned" : true,  "primary" : "rs0" }
                mydb.table chunks:
                                rs1     28
                                rs0     34

andre.defrere

unread,
Aug 28, 2012, 6:52:59 PM8/28/12
to mongod...@googlegroups.com
Hi Naslund,

There should be more output from the sh.status() - you should be able to see what shard keys you have set up and the ranges they cover.  Was there more output to that command, or was there a message telling you to run sh.status(true)?

Could we see the output of db.printCollectionStats()?

André

Naslund

unread,
Aug 29, 2012, 12:33:00 PM8/29/12
to mongod...@googlegroups.com
Thank you for your time. I tried again by deleting all the data and following the tutorial once again and it worked, with one exception. When I run db.stats() the total object should add up to 10,000 however I get 10,012 rs1 -> 3285 rs2 -> 3363 rs3 -> 3364 = 10,012 but when I view it in MongoVue I get the right numbers 3360 + 3359 + 3281 = 10,000

andre.defrere

unread,
Aug 30, 2012, 10:46:12 AM8/30/12
to mongod...@googlegroups.com
Hi Naslund,

One reason why you might be seeing what looks like more data in db.stats() is that the chunks are still being migrated between shards ater the insert.  This should be a temporary condition, and would disappear after all chunks were migrated.

Are you still seeing the issue?

André
Reply all
Reply to author
Forward
0 new messages