Hive连接报错,显示用户没有权限 org.apache.hadoop.ipc.RemoteException:User: xxx is not allowed to impersonate root

Hive连接报错,显示用户没有权限 org.apache.hadoop.ipc.RemoteException:User: xxx is not allowed to impersonate root

org.apache.hadoop.ipc.RemoteException:User: xxx is not allowed to impersonate root

xxx 是用户名,大概是Hive会对用户进行校验,而xxx并没被识别出来,造成连接出错,可以通过以下两种方法尝试解决

1.关闭主机校验

修改hive安装目录下conf/hive-site.xml,将hive.server2.enable.doAs设置成false

<property>
    <name>hive.server2.enable.doAs</name>
    <value>false</value>
    <description>
      Setting this property to true will have HiveServer2 execute
      Hive operations as the user making the calls to it.
    </description>
  </property>

2.设置主机代理

为hadoop安装目录下的core-site.xml添加如下配置

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

该设置下“root”为连接hive账号

猜你喜欢

转载自blog.csdn.net/qq_50665031/article/details/129732803
今日推荐