Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-17391

[Shell] Add shell command to get list of servers, with filters

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Patch Available
    • Major
    • Resolution: Unresolved
    • 1.3.0
    • 3.0.0-beta-2
    • shell

    Description

      For some operations, for example calling update_config, the user needs to specify the full server name. For region servers that is easier to find, but not so much for the master (using zk_dump works but is noisy). It woould be good to add a utility call that lists the servers, preferably with an optional filter (a regexp, server type, or globbing style format) that allows to whittle down the potentially long is of servers. For example:

      hbase(main):001:0> list_servers "master"
      master-1.internal.larsgeorge.com,16000,1483018890074
      
      hbase(main):002:0> list_servers "rs"
      slave-1.internal.larsgeorge.com,16020,1482996572051
      slave-3.internal.larsgeorge.com,16020,1482996572481
      slave-2.internal.larsgeorge.com,16020,1482996570909
      
      hbase(main):003:0> list_servers "rs:s.*\.com.*"
      slave-1.internal.larsgeorge.com,16020,1482996572051
      slave-3.internal.larsgeorge.com,16020,1482996572481
      slave-2.internal.larsgeorge.com,16020,1482996570909
      
      hbase(main):004:0> list_servers ":.*160?0.*"
      master-1.internal.larsgeorge.com,16000,1483018890074
      slave-1.internal.larsgeorge.com,16020,1482996572051
      slave-3.internal.larsgeorge.com,16020,1482996572481
      slave-2.internal.larsgeorge.com,16020,1482996570909
      

      I could imagine to have master, backup-master, rs, and maybe even zk too. The optional regexp shown uses a colon as a divider. This combines the "by-type", and using a filter. Example #4 skips the type and only is using the filter.

      Of course, you could also implement this differently, say with two parameters... just suggesting.

      Attachments

        1. HBASE-17391.master.000.patch
          3 kB
          Sreeram Venkatasubramanian
        2. HBASE-17391.master.001.patch
          3 kB
          Sreeram Venkatasubramanian
        3. HBASE-17391.master.002.patch
          3 kB
          Sreeram Venkatasubramanian
        4. HBASE-17391.master.003.patch
          3 kB
          Sreeram Venkatasubramanian
        5. HBASE-17391.master.004.patch
          5 kB
          Sreeram Venkatasubramanian
        6. HBASE-17391.master.005.patch
          5 kB
          Sreeram Venkatasubramanian
        7. HBASE-17391.master.006.patch
          6 kB
          Sreeram Venkatasubramanian
        8. HBASE-17391.master.007.patch
          6 kB
          Sreeram Venkatasubramanian

        Activity

          People

            Sreeram Sreeram Venkatasubramanian
            larsgeorge Lars George
            Votes:
            0 Vote for this issue
            Watchers:
            6 Start watching this issue

            Dates

              Created:
              Updated: