Uploaded image for project: 'Core Server'
  1. Core Server
  2. SERVER-18786

printShardingStatus/sh.status should give info of active mongoses

    XMLWordPrintableJSON

Details

    • Icon: Improvement Improvement
    • Resolution: Done
    • Icon: Major - P3 Major - P3
    • 3.1.9
    • None
    • 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

    Description

      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:

       > 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):

       > 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:
               ...
      

      Attachments

        Activity

          People

            kevin.pulo@mongodb.com Kevin Pulo
            kevin.pulo@mongodb.com Kevin Pulo
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: