【发布时间】:2021-07-26 10:41:14
【问题描述】:
我正在尝试在具有三个分片服务器的分片集群中对集合(db:mql,集合名称:teste)进行分片,但是,包含我的数据的唯一分片是主分片。
--- Sharding Status ---
sharding version: {
"_id" : 1,
"minCompatibleVersion" : 5,
"currentVersion" : 6,
"clusterId" : ObjectId("60907ccc078cdbdf9b66c6d0")
}
shards:
{ "_id" : "sh1", "host" : "sh1/localhost:27022", "state" : 1, "tags" : [ "NYC", "SF" ] }
{ "_id" : "sh2", "host" : "sh2/localhost:27023", "state" : 1 }
{ "_id" : "sh3", "host" : "sh3/localhost:27026", "state" : 1 }
active mongoses:
"4.2.13" : 1
autosplit:
Currently enabled: yes
balancer:
Currently enabled: yes
Currently running: no
Failed balancer rounds in last 5 attempts: 0
Migration Results for the last 24 hours:
853 : Success
databases:
{ "_id" : "config", "primary" : "config", "partitioned" : true }
config.system.sessions
shard key: { "_id" : 1 }
unique: false
balancing: true
chunks:
sh1 341
sh2 342
sh3 341
too many chunks to print, use verbose if you want to force print
{ "_id" : "mql", "primary" : "sh3", "partitioned" : true, "version" : { "uuid" : UUID("c2c07a45-b8a7-4468-a3ef-cd5bafd8999c"), "lastMod" : 1 } }
mql.teste
shard key: { "_id" : 1 }
unique: false
balancing: true
chunks:
sh3 1
{ "_id" : { "$minKey" : 1 } } -->> { "_id" : { "$maxKey" : 1 } } on : sh3 Timestamp(1, 0)
这是我检查集合是否分片时得到的结果:
mongos> db.collections.find( {_id: "mql.teste" , dropped : false } )
{
"_id" : "mql.teste",
"lastmodEpoch" : ObjectId("6090c18062e39651b4cd267c"),
"lastmod" : ISODate("1970-02-19T17:02:47.296Z"),
"dropped" : false,
"key" : { "_id" : 1 },
"unique" : false,
"uuid" : UUID("91d1fdd2-5062-404b-b2ec-28a1f6e15b3e")
}
【问题讨论】:
标签: mongodb nosql scalability sharding