其他分享
首页 > 其他分享> > JDBC连接Hive报错User: root is not allowed to impersonate anonymous

JDBC连接Hive报错User: root is not allowed to impersonate anonymous

作者:互联网

异常

java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://*****:10000/default: 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 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:* 中的用户名部分
我的报错是hduser,所有我改成:

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

然后使用JDBC对Hive插入数据修改数据时:

 

org.apache.hadoop.security.AccessControlException: Permission denied: user

修改配置hdfs-site.xml文件

<property>
  <name>dfs.permissions.enabled</name>
  <value>false</value>
</property>

 

标签:JDBC,proxyuser,hduser,hadoop,Hive,报错,User,root
来源: https://blog.csdn.net/imudges_Zy/article/details/89789947