请选择 进入手机版 | 继续访问电脑版

【Hive】beeline连接报错 root is not allowed to impersonate root (state

[复制链接]
东方龙头 发表于 2020-12-31 20:21:53 | 显示全部楼层 |阅读模式 打印 上一主题 下一主题
User: root is not allowed to impersonate root (state=08S01,code=0)

hive的客户端毗连服务使用metastore毗连hiveserver2没有出问题,而使用beeline毗连hiveserver2却出现如下问题
Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop02:10000: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: root is not allowed to impersonate root (state=08S01,code=0)
  1. [root@hadoop01 lib]# beelinewhich: no hbase in (.:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/vim82/bin:/usr/local/myJdk/bin:/usr/local/myJdk/lib:/usr/local/myHadoop/bin:/usr/local/myHadoop/sbin:/usr/local/hive/bin:/usr/local/python-3.7.3/bin:/usr/local/zookeeper/bin:/root/bin)Beeline version 2.1.1 by Apache Hivebeeline> !connect jdbc:hive2://hadoop02:10000SLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/usr/local/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Found binding in [jar:file:/usr/local/myHadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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]Connecting to jdbc:hive2://hadoop02:10000Enter username for jdbc:hive2://hadoop02:10000: rootEnter password for jdbc:hive2://hadoop02:10000: ******20/12/29 10:45:45 [main]: WARN jdbc.HiveConnection: Failed to connect to hadoop02:10000Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop02:10000: Failed to open new session: java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): User: root is not allowed to impersonate root (state=08S01,code=0)
复制代码
查询了网上的方法发现千篇一律,并没有办理我的问题
在研究后将我的办理的方法分享给各人
首先在hive的服务器端和客户端两个节点的core-site.xml配置文件内里加上下面的内容
  1.         hadoop.proxyuser.root.hosts        *        hadoop.proxyuser.root.groups        *
复制代码
然后将mysql-connector-java-5.1.28-bin.jar放入服务器端和客户端两个节点的hive/lib下
mysql-connector-java-5.1.28-bin.jar
如此
再将RunJar进程杀死,重启集群就办理问题了
  1. [root@hadoop01 lib]# beelinewhich: no hbase in (.:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/root/bin:/usr/local/vim82/bin:/usr/local/myJdk/bin:/usr/local/myJdk/lib:/usr/local/myHadoop/bin:/usr/local/myHadoop/sbin:/usr/local/hive/bin:/usr/local/python-3.7.3/bin:/usr/local/zookeeper/bin:/root/bin)Beeline version 2.1.1 by Apache Hivebeeline> !connect jdbc:hive2://hadoop02:10000SLF4J: Class path contains multiple SLF4J bindings.SLF4J: Found binding in [jar:file:/usr/local/hive/lib/log4j-slf4j-impl-2.4.1.jar!/org/slf4j/impl/StaticLoggerBinder.class]SLF4J: Found binding in [jar:file:/usr/local/myHadoop/share/hadoop/common/lib/slf4j-log4j12-1.7.10.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]Connecting to jdbc:hive2://hadoop02:10000Enter username for jdbc:hive2://hadoop02:10000: rootEnter password for jdbc:hive2://hadoop02:10000: ******Connected to: Apache Hive (version 2.1.1)Driver: Hive JDBC (version 2.1.1)20/12/29 10:50:48 [main]: WARN jdbc.HiveConnection: Request to set autoCommit to false; Hive does not support autoCommit=false.Transaction isolation: TRANSACTION_REPEATABLE_READ0: jdbc:hive2://hadoop02:10000>
复制代码
官方mysql-connector-java-5.1.28-bin.jar
mysql-connector-java-5.1.28-bin.jar

来源:https://blog.csdn.net/qq_52241909/article/details/111884774
免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

发布主题

专注素材教程免费分享
全国免费热线电话

18768367769

周一至周日9:00-23:00

反馈建议

27428564@qq.com 在线QQ咨询

扫描二维码关注我们

Powered by Discuz! X3.4© 2001-2013 Comsenz Inc.( 蜀ICP备2021001884号-1 )