错误信息
22/04/02 20:19:23 [main]: WARN jdbc.HiveConnection: Failed to connect to hadoop102:10000
Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop102:10000:
Failed to open new session: java.lang.RuntimeException:org.apache.hadoop.ipc.RemoteException
(org.apache.hadoop.security.authorize.AuthorizationException):
User: xxx is not allowed to impersonate xxx(state=08S01,code=0)
原因是该用户权限不够,在hadoop安装目录下,修改core-site.xml,添加如下信息:
xxx就是报错信息中的用户名
<property>
<name>hadoop.proxyuser.xxx.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.xxx.groups</name>
<value>*</value>
</property>
添加完之后需要更新信息到服务器上,分别运行下面两句。
hdfs dfsadmin -refreshSuperUserGroupsConfiguration
yarn rmadmin -refreshSuperUserGroupsConfiguration
重启之后返回hive目录,再次启动beeline即可
bin/beeline -u jdbc:hive2://hadoop102:10000 -n xxx
参考:https://blog.csdn.net/qq_43668173/article/details/115277021