-
Type:
Improvement
-
Resolution: Done
-
Priority:
Major - P3
-
Affects Version/s: None
-
Component/s: Diagnostics, Sharding
-
None
-
Fully Compatible
-
Sharding 6 07/17/15, Sharding 7 08/10/15, Sharding 8 08/28/15, Sharding 9 (09/18/15), Sharding A (10/09/15)
-
0
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In the output of printShardingStatus() / sh.status(), it would be good if there was a "mongos" section (eg. next to "shards"). This would show info about the "active" mongoses (as found by applying some appropriate threshold to the ping time values in config.mongos, eg. 2 mins before the most recent ping).
For example, if verbose is false, then just a basic count and list of the mongos versions found:
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" : 5,
"currentVersion" : 6,
"clusterId" : ObjectId("552720847d69a9cc3ebd4313")
}
shards:
{ "_id" : "shard1", "host" : "shard1/s11:27018,s12:27018" }
{ "_id" : "shard2", "host" : "shard2/s21:27018,s22:27018" }
+ active mongoses:
+ "3.0.3" : 4
+ "3.0.2" : 2
balancer:
...
databases:
...
Or, if verbose is true, then one line for each active mongos (sorted by ping):
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(true) --- Sharding Status --- sharding version: { "_id" : 1, "minCompatibleVersion" : 5, "currentVersion" : 6, "clusterId" : ObjectId("552720847d69a9cc3ebd4313") } shards: { "_id" : "shard1", "host" : "shard1/s11:27018,s12:27018" } { "_id" : "shard2", "host" : "shard2/s21:27018,s22:27018" } + active mongoses: + { "_id" : "mongos5:27017", "ping" : ISODate("2015-06-01T07:09:40.274Z"), "up" : 986036, "waiting" : true, "mongoVersion" : "3.0.3" } + { "_id" : "mongos2:27017", "ping" : ISODate("2015-06-01T07:09:24.989Z"), "up" : 986256, "waiting" : true, "mongoVersion" : "3.0.3" } + { "_id" : "mongos6:27017", "ping" : ISODate("2015-06-01T07:09:20.812Z"), "up" : 986116, "waiting" : true, "mongoVersion" : "3.0.3" } + { "_id" : "mongos3:27017", "ping" : ISODate("2015-06-01T07:09:19.483Z"), "up" : 985982, "waiting" : true, "mongoVersion" : "3.0.3" } + { "_id" : "mongos2:27017", "ping" : ISODate("2015-06-01T07:09:13.066Z"), "up" : 4445957, "waiting" : true, "mongoVersion" : "3.0.2" } + { "_id" : "mongos1:27017", "ping" : ISODate("2015-06-01T07:09:12.989Z"), "up" : 4507109, "waiting" : true, "mongoVersion" : "3.0.2" } balancer: ... databases: ...