Apache Ranger 2.4.0 集成Hive 3.x(Kerbos)

一、解压tar包

tar zxvf ranger-2.4.0-hive-plugin.tar.gz

二、修改install.propertis

复制代码
POLICY_MGR_URL=http://localhost:6080

REPOSITORY_NAME=hive_repo

COMPONENT_INSTALL_DIR_NAME=/BigData/run/hive

CUSTOM_USER=hadoop

三、进行enable

复制代码
[root@tv3-hadoop-01 ranger-2.4.0-hive-plugin]# ./enable-hive-plugin.sh

看到下面的内容后,已经初始化完毕,需要重启meta和hive服务

复制代码
Ranger Plugin for hive has been enabled. Please restart hive to ensure that changes are effective.

nohup hive --service metastore &

nohup hive --service hiveserver2 &

四、验证服务状态

服务正常,但是权限已经受到管控,需要进行授权

复制代码
[hadoop@tv3-hadoop-01 ~]$ beeline
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/home/hadoop/gf13871/apache-hive-3_1_3/lib/log4j-slf4j-impl-2.17.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/BigData/install/hadoop-3.3.1/share/hadoop/common/lib/slf4j-log4j12-1.7.30.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Beeline version 3.1.3 by Apache Hive
beeline> !connect jdbc:hive2://tv3-hadoop-01:10000/default;principal=hadoop/tv3-hadoop-01@AB.ELONG.COM
Connecting to jdbc:hive2://tv3-hadoop-01:10000/default;principal=hadoop/tv3-hadoop-01@AB.ELONG.COM
Connected to: Apache Hive (version 3.1.3)
Driver: Hive JDBC (version 3.1.3)
Transaction isolation: TRANSACTION_REPEATABLE_READ
0: jdbc:hive2://tv3-hadoop-01:10000/default> show tables;
Error: Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [hadoop] does not have [USE] privilege on [default] (state=42000,code=40000)
0: jdbc:hive2://tv3-hadoop-01:10000/default> 

五、Ranger 授权

六、相关报错

6.1 测试连接时出现下面报错(待解决)

复制代码
org.apache.ranger.plugin.client.HadoopException: Unable to execute SQL [show databases like "*"]..
Error while compiling statement: FAILED: HiveAccessControlException Permission denied: user [rangerlookup] does not have [USE] privilege on [Unknown resource!!].
Permission denied: user [rangerlookup] does not have [USE] privilege on [Unknown resource!!].
相关推荐
8***a81521 小时前
从0到1部署Tomcat和添加servlet(IDEA2024最新版详细教程)
hive·servlet·tomcat
SelectDB1 天前
宇信科技基于 SelectDB & Apache Doris 构建实时智能的银行经营分析平台
数据库·apache
SelectDB1 天前
上海证券 SelectDB 升级实践:湖仓流批一体落地与 Elasticsearch 全面替换
数据库·apache
熊文豪2 天前
工业物联网时序数据库选型指南:Apache IoTDB 的技术优势与应用实践
物联网·apache·时序数据库·iotdb
一个天蝎座 白勺 程序猿2 天前
Apache IoTDB(10):数据库操作——从查询到优化的全链路实践指南
数据库·apache·时序数据库·iotdb
云计算老刘2 天前
1.项目实战:LAMP-LNMP-分离部署
linux·mysql·php·apache·mariadb
SelectDB2 天前
字节跳动:Apache Doris + AI 一站式融合数据引擎的探索与实践
数据库·apache
可涵不会debug2 天前
时序数据库选型指南:大数据时代下Apache IoTDB的崛起之路
大数据·apache·时序数据库
p***q782 天前
【保姆级教程】apache-tomcat的安装配置教程
java·tomcat·apache
SelectDB2 天前
Apache Doris 中的 Data Trait:性能提速 2 倍的秘密武器
数据库·后端·apache