User: root is not allowed to impersonate root

Error: Could not open client transport with JDBC Uri: jdbc:hive2://node1: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)
User: root is not allowed to impersonate root
修改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>

User: root is not allowed to impersonate root
Hadoop.proxyuser.root.hosts配置项名称中root部分为报错User:* 中的用户名部分

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

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

重启hadoop
启动hive
登录beeline

!connect jdbc:hive2://node1:10000
username是root
password 直接回车即可
上一篇:导入SQL文件到MySQL报错 - 2006 - MySQL server has gone away


下一篇:【字符串】1684. 统计一致字符串的数目