-
Type:
Improvement
-
Resolution: Done
-
Priority:
Major - P3
-
None
-
Affects Version/s: None
-
Sharding EMEA
-
None
-
None
-
None
-
None
-
None
-
None
-
None
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.:
Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
> 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.:
Unable to find source-code formatter for language: diff. Available languages are: actionscript, ada, applescript, bash, c, c#, c++, cpp, css, erlang, go, groovy, haskell, html, java, javascript, js, json, lua, none, nyan, objc, perl, php, python, r, rainbow, ruby, scala, sh, sql, swift, visualbasic, xml, yaml
> 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().