我的典型文件是:
{ "_id" : ObjectId("5093c2fbf6c07ab5a3ac779b"), "msid" : BinData(3,"3xGNFeKqXR4Zx0Q+FgCviA=="), "mt" : ISODate("2010-01-01T03:41:07Z")}
我有2个分片。 " MSID"是文档推荐的二进制形式的UUID,用于提高空间效率。但是当msid被字符串分片工作时。现在只有一个碎片被普及。
mongos> sh.status()
--- Sharding Status ---
sharding version: { "_id" : 1, "version" : 3 }
shards:
{ "_id" : "shard0000", "host" : "rs1/vserver-dev-2:37018,vserver-dev-3:37018" }
{ "_id" : "shard0001", "host" : "rs2/vserver-dev-2:47018,vserver-dev-3:47018" }
databases:
{ "_id" : "admin", "partitioned" : false, "primary" : "config" }
{ "_id" : "test", "partitioned" : false, "primary" : "shard0000" }
{ "_id" : "ifms", "partitioned" : true, "primary" : "shard0000" }
ifms.measurement_event chunks:
shard0000 1
{ "msid" : { $minKey : 1 } } -->> { "msid" : { $maxKey : 1 } } on : shard0000 Timestamp(1000, 0)
{ "_id" : "mongo", "partitioned" : false, "primary" : "shard0001" }
最小/最大键似乎有问题。
和chunk:
mongos> db.chunks.find().pretty()
{
"_id" : "ifms.measurement_event-msid_MinKey",
"lastmod" : Timestamp(1000, 0),
"lastmodEpoch" : ObjectId("5093afb369b03db47a1311eb"),
"ns" : "ifms.measurement_event",
"min" : {
"msid" : { $minKey : 1 }
},
"max" : {
"msid" : { $maxKey : 1 }
},
"shard" : "shard0000"
}
db现在有大约100万个文件,每个文件大约180字节。