Hbase权限控制

参考

https://blog.csdn.net/shenliang1985/article/details/51420332

habse权限管理

grant 'hive', 'R', 'TestTable'

revoke 'hive', 'TestTable'

user_permission 'TestTable'

hbase(main):005:0> grant

ERROR: First argument should be a String

Grant users specific rights.
Syntax: grant <user or @group>, <permissions> [, <table> [, <column family> [, <column qualifier>]]]
Syntax: grant <user or @group>, <permissions>, <@namespace>

permissions is either zero or more letters from the set "RWXCA".
READ('R'), WRITE('W'), EXEC('X'), CREATE('C'), ADMIN('A')

Note: Groups and users are granted access in the same way, but groups are prefixed with an '@'
       character. Tables and namespaces are specified the same way, but namespaces are
       prefixed with an '@' character.

For example:

    hbase> grant 'bobsmith', 'RWXCA'
     hbase> grant '@admins', 'RWXCA'
     hbase> grant 'bobsmith', 'RWXCA', '@ns1'
     hbase> grant 'bobsmith', 'RW', 't1', 'f1', 'col1'
     hbase> grant 'bobsmith', 'RW', 'ns1:t1', 'f1', 'col1'

Took 0.0032 seconds                                                                                                                                                                                                                                                          
hbase(main):006:0> revoke

ERROR: wrong number of arguments (0 for 1)

Revoke a user's access rights.
Syntax: revoke <user or @group> [, <table> [, <column family> [, <column qualifier>]]]
Syntax: revoke <user or @group>, <@namespace>

Note: Groups and users access are revoked in the same way, but groups are prefixed with an '@'
       character. Tables and namespaces are specified the same way, but namespaces are
       prefixed with an '@' character.

For example:

    hbase> revoke 'bobsmith'
     hbase> revoke '@admins'
     hbase> revoke 'bobsmith', '@ns1'
     hbase> revoke 'bobsmith', 't1', 'f1', 'col1'
     hbase> revoke 'bobsmith', 'ns1:t1', 'f1', 'col1'

Took 0.0035 seconds                                                                                                                                                                                                                                                          
hbase(main):007:0>

您可以选择一种方式赞助本站