You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@hbase.apache.org by "Zheng Hu (JIRA)" <ji...@apache.org> on 2017/02/21 09:45:44 UTC

[jira] [Commented] (HBASE-16990) Shell tool to dump table and namespace privileges

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

Zheng Hu commented on HBASE-16990:
----------------------------------

Currently,  grants_dumper.rb  script works fine.  it will has following feature:
{code}
Dump HBase Table/Namespace grants

Example:
  bash hbase-jruby grants_dumper.rb -h | --help                           # show usage
  bash hbase-jruby grants_dumper.rb t1                                        #  dump permission of table t1
  bash hbase-jruby grants_dumper.rb t1 t2                                    # dump permission of table t1 & t2
  bash hbase-jruby grants_dumper.rb -w <file> t1 t2                      # dump permission of table t1 & t2 to <file>
  bash hbase-jruby grants_dumper.rb t1 @ns1 t2                          # dump permission of table t1 & t2, namespace ns1
  bash hbase-jruby grants_dumper.rb -w <file> t1 @ns1 t2            # dump permission of table t1 & t2, namespace ns1 to <file>
  bash hbase-jruby grants_dumper.rb --namespace ns1                 # dump permission of all table under namespace
  bash hbase-jruby grants_dumper.rb --namespace ns1 -w <file>   # dump permission of all table under namespace to <file>
  bash hbase-jruby grants_dumper.rb --all                                        # dump permission of all table
  bash hbase-jruby grants_dumper.rb --all -w <file>                         # dump permission of all table to <file>
{code} 


> Shell tool to dump table and namespace privileges
> -------------------------------------------------
>
>                 Key: HBASE-16990
>                 URL: https://issues.apache.org/jira/browse/HBASE-16990
>             Project: HBase
>          Issue Type: New Feature
>          Components: tooling
>            Reporter: Zheng Hu
>            Assignee: Zheng Hu
>            Priority: Minor
>         Attachments: HBASE-16990.v1.patch
>
>
> Recently,  we are trying to migrate tables from Cluster-A to Cluster-B,  I found that HBase lack some useful tools :
> 1.  dump table schema,  like mysqldump in mysql
> 2.  dump table privileges,  like pt-show-grants in mysql provided by Percona. 
> I think we can add a dump sub-command looks like (JUST simple demo) : 
> {code}
> $ ./bin/hbase dump  -t test_table  --with-privileges  > ~/test_table.hsh
> $ cat ~/test_table.hsh
> create 'test_table', {NAME=>'f1'} 
> grant 'test_user', 'RW', 'test_table'
> {code}
> Maybe I can contribute ...  :)
> How do you think ?  



--
This message was sent by Atlassian JIRA
(v6.3.15#6346)