User root is not allowed to impersonate anonymous

断了今生、忘了曾经 提交于 2020-11-21 12:07:09

User root is not allowed to impersonate anonymous

使用HiveServer2 and Beeline模式运行时,启动好HiveServer后运行

beeline -u jdbc:hive2://localhost:10000 -n root 连接server时
出现
java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoop.security.authorize.AuthorizationException): 
User root is not allowed to impersonate anonymous 错误。
  • 修改hadoop 配置文件 etc/hadoop/core-site.xml,加入如下配置项
<property>     <name>hadoop.proxyuser.root.hosts</name>     <value>*</value> </property> <property>     <name>hadoop.proxyuser.root.groups</name>     <value>*</value> </property>

 

    hadoop.proxyuser.root.hosts配置项名称中root部分为报错User:* 中的用户名部分,如wulei!!!!!!!

    例如User: zhaoshb is not allowed to impersonate anonymous则需要将xml变更为如下格式

<property>     <name>hadoop.proxyuser.zhaoshb.hosts</name>     <value>*</value> </property> <property>     <name>hadoop.proxyuser.zhaoshb.groups</name>     <value>*</value> </property>

 

  • 重启hadoop
  • 测试:./beeline -u 'jdbc:hive2://localhost:10000/userdb' -n username(替换为上述的用户名部分)
标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!