You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Yi Liang (JIRA)" <ji...@apache.org> on 2017/01/11 00:32:58 UTC

[jira] [Commented] (HBASE-17391) [Shell] Add shell command to get list of servers, with filters

    [ https://issues.apache.org/jira/browse/HBASE-17391?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15816659#comment-15816659 ] 

Yi Liang commented on HBASE-17391:
----------------------------------

Hi [~larsgeorge]
   Have your tried status command, this is quite similar to your list_servers command, see jira HBASE-14805. I think maybe we can modify the status command, rather than create new one. What do you think?

> [Shell] Add shell command to get list of servers, with filters
> --------------------------------------------------------------
>
>                 Key: HBASE-17391
>                 URL: https://issues.apache.org/jira/browse/HBASE-17391
>             Project: HBase
>          Issue Type: Improvement
>          Components: shell
>    Affects Versions: 1.3.0
>            Reporter: Lars George
>              Labels: beginner, beginners
>
> 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:
> {noformat}
> 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
> {noformat}
> 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.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)