设为首页 加入收藏

TOP

Ranger错误:Unable to connect to Hive Thrift Server instance..
2018-11-26 17:05:16 】 浏览:353
Tags:Ranger 错误 :Unable connect Hive Thrift Server instance..
Ranger测试hive连接错误提示:
org.apache.ranger.plugin.client.HadoopException: Unable to connect to Hive Thrift Server instance..
Unable to connect to Hive Thrift Server instance..
Could not open client transport for any of the Server URI's in ZooKeeper: Could not establish connection to jdbc:hive2://c2bde55:10000/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default}).
Could not establish connection to jdbc:hive2://c2bde55:10000/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default}).

Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default}).


解决办法:
使用hdp2.6.1出现,原因是hive相关jar包不匹配问题
1)备份目录:
# cd /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/
# cp -r hive hive.bak
2)清空,重新拷贝hive jar包和它的依赖包
rm -rf /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive/*
cp -r /usr/hdp/2.6.1.0-129/hive/lib/hive-common*.jar /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive
cp -r /usr/hdp/2.6.1.0-129/hive/lib/hive-jdbc*.jar /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive
cp -r /usr/hdp/2.6.1.0-129/hive/lib/hive-exec*.jar /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive
cp -r /usr/hdp/2.6.1.0-129/hive/lib/hive-metastore*.jar /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive
cp -r /usr/hdp/2.6.1.0-129/hive/lib/hive-service*.jar /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive
cp -r /usr/hdp/2.6.1.0-129/hive/lib/libfb303*.jar /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive
cp -r /usr/hdp/2.6.1.0-129/hive/lib/libthrift*.jar /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive
chmod -R a+x /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive
cp ../hive.bak/ranger-hive-plugin-0.7.0.2.6.1.0-129.jar /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive/
3) 改变拥有者
chown -R ranger:ranger /usr/hdp/2.6.1.0-129/ranger-admin/ews/webapp/WEB-INF/classes/ranger-plugins/hive
4)重启ranger服务,然后测试连接。


注明:此方法通过Ranger授权可能无效,其他方法:因为Ranger插件默认使用的是hive2,所以需Ambari中hive组件开启HiveServer2 Interactive

同时修改Ranger中hive服务的jdbc.url *值为:

jdbc:hive2:/ip:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2-hive2

】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
上一篇Exception in thread "main&.. 下一篇Hadoop2.7.2之Hive-2.1.1的Hivese..

最新文章

热门文章

Hot 文章

Python

C 语言

C++基础

大数据基础

linux编程基础

C/C++面试题目