ICode9

精准搜索请尝试: 精确搜索
首页 > 其他分享> 文章详细

Hbase-10-权限管理

2021-07-23 17:01:09  阅读:181  来源: 互联网

标签:10 revoke permission bobsmith user Hbase 权限 hbase


授权范围:

名称 描述
Superuser 超级账号可以进行任何操作,运行HBase服务的账号默认是 Superuser。也可以通过在hbase-site.xml中配置hbase.superuser的值可以添加超级账号。
Global Global Scope拥有集群所有table的Admin权限。
Namespace 在Namespace Scope进行相关权限控制。
Table 在Table Scope进行相关权限控制。
ColumnFamily 在ColumnFamily Scope进行相关权限控制。
Cell 在Cell Scope进行相关权限控制。

Grant 授权

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'

我们可以从RWXCA组,其中给予零个或多个特权给用户

  • R - 代表读取权限
  • W - 代表写权限
  • X - 代表执行权限
  • C - 代表创建权限
  • A - 代表管理权限

revoke 删除权限

revoke命令用于撤销用户访问表的权限。它的语法如下:

hbase:002:0> help "revoke"
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'

user_permission 查询权限

hbase:001:0> help "user_permission"
Show all permissions for the particular user.
Syntax : user_permission <table>

Note: A namespace must always precede with '@' character.

For example:

    hbase> user_permission
    hbase> user_permission '@ns1'
    hbase> user_permission '@.*'
    hbase> user_permission '@^[a-c].*'
    hbase> user_permission 'table1'
    hbase> user_permission 'namespace1:table1'
    hbase> user_permission '.*'
    hbase> user_permission '^[A-C].*'

标签:10,revoke,permission,bobsmith,user,Hbase,权限,hbase
来源: https://www.cnblogs.com/shix0909/p/15049616.html

本站声明: 1. iCode9 技术分享网(下文简称本站)提供的所有内容,仅供技术学习、探讨和分享;
2. 关于本站的所有留言、评论、转载及引用,纯属内容发起人的个人观点,与本站观点和立场无关;
3. 关于本站的所有言论和文字,纯属内容发起人的个人观点,与本站观点和立场无关;
4. 本站文章均是网友提供,不完全保证技术分享内容的完整性、准确性、时效性、风险性和版权归属;如您发现该文章侵犯了您的权益,可联系我们第一时间进行删除;
5. 本站为非盈利性的个人网站,所有内容不会用来进行牟利,也不会利用任何形式的广告来间接获益,纯粹是为了广大技术爱好者提供技术内容和技术思想的分享性交流网站。

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有