Uploaded image for project: 'MongoDB Database Tools'
  1. MongoDB Database Tools
  2. TOOLS-601

mongostat --discover does not alias localhost to the target hostname

    • Type: Icon: Bug Bug
    • Resolution: Done
    • Priority: Icon: Major - P3 Major - P3
    • 3.2.8, 3.3.11
    • Affects Version/s: 3.0.0-rc6
    • Component/s: mongostat
    • None
    • v3.2

      This one I know to be an existing issue with mongostat 2.6 and earlier.

      To reproduce:
      1.) Start up a vanilla 3 node set on say ports 2400, 2401, 2402.
      2.) $ mongostat --port 2400 --discover 5

                                          insert query update delete getmore command flushes mapped vsize  res faults     locked db idx miss % qr|qw ar|aw netIn netOut conn      set repl     time
      John-Morales-MacBook-Pro.local:2400     *0    *0     *0     *0       0     2|0       0 288.0M  2.7G 7.0M      0    local:0.0%          0   0|0   0|0  224b     1k    6 two-four  SEC 22:35:59
      John-Morales-MacBook-Pro.local:2401     *0    *0     *0     *0       0     1|0       0 288.0M  2.8G 6.0M      0    local:0.0%          0   0|0   0|0  177b   668b    7 two-four  PRI 22:35:59
      John-Morales-MacBook-Pro.local:2402     *0    *0     *0     *0       0     1|0       0 288.0M  2.8G 6.0M      0    local:0.0%          0   0|0   0|0  178b   628b    8 two-four  SEC 22:35:59
                           localhost:2400     *0    *0     *0     *0       0     2|0       0 288.0M  2.7G 7.0M      0    local:0.0%          0   0|0   0|0  247b     1k    5 two-four  SEC 22:35:59
      
      John-Morales-MacBook-Pro.local:2400     *0    *0     *0     *0       0     2|0       0 288.0M  2.7G 7.0M      0    local:0.0%          0   0|0   0|0  224b     1k    7 two-four  SEC 22:36:04
      John-Morales-MacBook-Pro.local:2401     *0    *0     *0     *0       0     2|0       0 288.0M  2.8G 6.0M      0    local:0.0%          0   0|0   0|0  237b   790b    7 two-four  PRI 22:36:04
      John-Morales-MacBook-Pro.local:2402     *0    *0     *0     *0       0     2|0       0 288.0M  2.8G 6.0M      0    local:0.0%          0   0|0   0|0  227b   791b    7 two-four  SEC 22:36:04
                           localhost:2400     *0    *0     *0     *0       0     2|0       0 288.0M  2.7G 7.0M      0    local:0.0%          0   0|0   0|0  213b     1k    7 two-four  SEC 22:36:04
      

      Note the repeated entries for the mongod on 2400 – one for localhost and another for the hostname.

      A workaround does exist of specifying the correct hostname instead of letting mongostat default to localhost, e.g.,
      $ mongostat --host John-Morales-MacBook-Pro.local --port 2400 --discover 5

        There are no Sub-Tasks for this issue.

            Assignee:
            zach.snow Zach Snow
            Reporter:
            john.morales@mongodb.com John Morales (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated:
              Resolved: