hive新建db、授权及权限回收
发布日期:2022-02-14 23:02:58 浏览次数:46 分类:技术文章

本文共 882 字,大约阅读时间需要 2 分钟。

# osuseradd username# useradd test# shellbeeline!connect jdbc:hive2://hive_server:hive_port hive hivecreate database db_name;# create database test_db;create role role_name;# create role test;grant all on database db_name to role role_name;# grant all on database test_db to role test;grant role role_name to group group_name;# grant role test to group test;# 外部表  否则权限问题造成create table 失败grant all on uri 'hdfs://nameservice1/hdfs_path' to role role_name;  # 其中:hdfs_path 为数据存储路径; nn1 为namenode ha# 测试beeline!connect jdbc:hive2://hive_server:hive_port username username# 对其它role授权select grant select on table table_name to role role_name; grant select on database db_name to role role_name;# 权限回收revoke select on database db_name from role role_name;#  beeline基本操作show databases;show roles;# show当前角色SHOW CURRENT ROLES;# 查询指定角色拥有的权限SHOW GRANT ROLE role_name;#  SHOW GRANT ROLE test;

转载地址:https://blog.csdn.net/fish2009122/article/details/90201335 如侵犯您的版权,请留言回复原文章的地址,我们会给您删除此文章,给您带来不便请您谅解!

上一篇:python操作hdfs
下一篇:hive批量导出表结构

发表评论

最新留言

路过按个爪印,很不错,赞一个!
[***.219.124.196]2024年04月13日 12时13分53秒

关于作者

    喝酒易醉,品茶养心,人生如梦,品茶悟道,何以解忧?唯有杜康!
-- 愿君每日到此一游!

推荐文章