报错内容:
24/10/13 15:08:35 [main]: WARN jdbc.HiveConnection: Failed to connect to node1:10000
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)
问题:
执行 ! connect jdbc:hive2://node1:10000,用root连接hive时报错显示如下
报错原因是:Beeline 连接到 Hive 时遇到了权限问题。具体来说,用户 root
尝试连接到 Hive 服务器时,Hive 不允许 root
用户模拟(impersonate)自己或其他用户。
解决方法:
在hadoop的安装目录下修改core-size.xml配置文件添加如下记得3台机器全部都要修改
该配置文件一般在hadoop的安装目录下的 etc/hadoop下
<property>
<name>hadoop.proxyuser.root.hosts</name>
<value>*</value>
</property>
<property>
<name>hadoop.proxyuser.root.groups</name>
<value>*</value>
</property>
之后重启hadoop和hive
#关掉hadoop
stop-all.sh
#关掉hive
kill -9 两个RunJar的进程
# 启动hadoop
start-all.sh
#启动hive服务
nohup /export/server/apache-hive-3.1.2-bin/bin/hive --service metastore &
nohup /export/server/apache-hive-3.1.2-bin/bin/hive --service hiveserver2 &
重新连接hive
成功!
标签:bin,10000,hadoop,hive,apache,报错,node1,root From: https://blog.csdn.net/weixin_62731303/article/details/142899184