2013-09-30 86 views
1

我已經創建了兩個碎片,並應用分片到集合的帖子,其具體內容:拆分不會發生

sh.status() 

--- Sharding Status --- 
    sharding version: { 
     "_id" : 1, 
     "version" : 3, 
     "minCompatibleVersion" : 3, 
     "currentVersion" : 4, 
     "clusterId" : ObjectId("50fde9a8552b8ce5c47c8ead") 
} 
    shards: 
     { "_id" : "rs0", "host" : "rs0/serv1:27017,serv2:27017,serv3:27017" } 
     { "_id" : "rs1", "host" : "rs1/serv4:27017,serv5:27017,serv6:27017" } 
    databases: 
     { "_id" : "admin", "partitioned" : false, "primary" : "config" } 
     { "_id" : "myposts", "partitioned" : true, "primary" : "rs0" } 
       myposts.posts 
         shard key: { "_id" : "hashed" } 
         chunks: 
           rs0 2 
         { "_id" : { "$minKey" : 1 } } -->> { "_id" : NumberLong(0) } on : rs0 Timestamp(1, 0) 
         { "_id" : NumberLong(0) } -->> { "_id" : { "$maxKey" : 1 } } on : rs0 Timestamp(1, 1) 

我插入20萬行數據:

mongos> db.posts.count() 
201002 
mongos> 

db.posts.find ().explain()給出以下結果:

{ 
     "clusteredType" : "ParallelSort", 
     "shards" : { 
       "rs0/serv1:27017,serv2:27017,serv3:27017" : [ 
         { 
           "cursor" : "BasicCursor", 
           "isMultiKey" : false, 
           "n" : 201002, 
           "nscannedObjects" : 201002, 
           "nscanned" : 201002, 
           "nscannedObjectsAllPlans" : 201002, 
           "nscannedAllPlans" : 201002, 
           "scanAndOrder" : false, 
           "indexOnly" : false, 
           "nYields" : 1, 
           "nChunkSkips" : 0, 
           "millis" : 587, 
           "indexBounds" : { 

           }, 
           "server" : "serv1:26016" 
         } 
       ] 
     }, 
     "cursor" : "BasicCursor", 
     "n" : 201002, 
     "nChunkSkips" : 0, 
     "nYields" : 1, 
     "nscanned" : 201002, 
     "nscannedAllPlans" : 201002, 
     "nscannedObjects" : 201002, 
     "nscannedObjectsAllPlans" : 201002, 
     "millisShardTotal" : 587, 
     "millisShardAvg" : 587, 
     "numQueries" : 1, 
     "numShards" : 1, 
     "indexBounds" : { 

     }, 
     "millis" : 589 
} 

插入到集合中的每個文檔都是26KB

回答

0

得到答案:沒有發生,因爲ntp時間沒有同步。