Hive Beeline连接报错:Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop102:10000

使用 JDBC 方式访问 Hive 时出现以下报错:
Connecting to jdbc:hive2://hadoop102:10000
22/11/27 15:00:53 [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: moran is not allowed to impersonate moran (state=08S01,code=0)
Beeline version 3.1.2 by Apache Hive

解决方案如下:

在hadoop的配置文件core-site.xml增加如下配置,重启hdfs,其中“moran”是连接beeline的用户,将“moran”替换成自己的用户名即可。

	
	    
        hadoop.proxyuser.moran.hosts
        *
    
    
        hadoop.proxyuser.moran.groups
        *
    

注意:

1)在修改完配置文件之后,一定要重启Hadoop集群

2)重启Hadoop集群前,先看下有没有多余进程,有的话,就先kill掉,再重启

Hive Beeline连接报错:Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop102:10000_第1张图片

 再次连接,即可成功了

Hive Beeline连接报错:Error: Could not open client transport with JDBC Uri: jdbc:hive2://hadoop102:10000_第2张图片

你可能感兴趣的:(Hive,hive,hadoop,大数据)