Details
-
Improvement
-
Resolution: Done
-
Major - P3
-
None
-
None
-
Sharding EMEA
Description
Determining the overall balance of a cluster from the output of sh.status() requires scrolling through all the sharded collections. If there are a lot of sharded collections[1], this is a pain.
Thus the output should include an overall summary of the chunk distribution among the shards.
Either augment the existing "shards" output to include the number of chunks, e.g.:
> sh.status()
|
--- Sharding Status ---
|
sharding version: {
|
"_id" : 1,
|
"minCompatibleVersion" : 6,
|
"currentVersion" : 7,
|
"clusterId" : ObjectId("556f97135efa42f9f4eaedd1")
|
}
|
shards:
|
- { "_id" : "shard01", "host" : "genique:11112" }
|
- { "_id" : "shard02", "host" : "genique:11113" }
|
+ { "_id" : "shard01", "host" : "genique:11112", numChunks: 34 }
|
+ { "_id" : "shard02", "host" : "genique:11113", numChunks: 22 }
|
balancer:
|
Currently enabled: yes
|
Currently running: no
|
Failed balancer rounds in last 5 attempts: 0
|
Migration Results for the last 24 hours:
|
No recent migrations
|
databases:
|
... |
Or else add a new top-level "chunks" section (mimicking the per-collection output), e.g.:
> sh.status()
|
--- Sharding Status ---
|
sharding version: {
|
"_id" : 1,
|
"minCompatibleVersion" : 6,
|
"currentVersion" : 7,
|
"clusterId" : ObjectId("556f97135efa42f9f4eaedd1")
|
}
|
shards:
|
{ "_id" : "shard01", "host" : "genique:11112" }
|
{ "_id" : "shard02", "host" : "genique:11113" }
|
balancer:
|
Currently enabled: yes
|
Currently running: no
|
Failed balancer rounds in last 5 attempts: 0
|
Migration Results for the last 24 hours:
|
No recent migrations
|
+ chunks:
|
+ shard01 34
|
+ shard02 22
|
databases:
|
... |
[1]: Or worse, a lot of sharded collections with just under 20 chunks (or verbose=true was used) and/or shard keys that exceed 1 line in tojson().