使用jdbc连接hive报错:java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoo...

使用jdbc连接hive报错:Connecting to jdbc:hive2://node002:10000
21/08/01 22:12:31 [main]: WARN jdbc.HiveConnection: Failed to connect to node002:10000
Could not open connection to the HS2 server. Please check the server URI and if the URI is correct, then ask the administrator to check the server status.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://node002:10000: java.net.ConnectException: 拒绝连接 (Connection refused) (state=08S01,code=0)
Beeline version 3.1.2 by Apache Hive

解决办法:https://hadoop.apache.org/docs/current/hadoop-project-dist/hadoop-common/Superusers.html

示例:bin/beeline -u jdbc:hive2://node002:10000 -n dataManager
hdfs core-site.xml 添加如下配置:


hadoop.proxyuser.dataManager.hosts
node001,node002,node003


hadoop.proxyuser.dataManager.groups
dataManager

Configurations
You can configure proxy user using properties hadoop.proxyuser.$superuser.hosts along with either or both of hadoop.proxyuser.$superuser.groups and hadoop.proxyuser.$superuser.users.

By specifying as below in core-site.xml, the superuser named super can connect only from host1 and host2 to impersonate a user belonging to group1 and group2.


hadoop.proxyuser.super.hosts
host1,host2


hadoop.proxyuser.super.groups
group1,group2

If these configurations are not present, impersonation will not be allowed and connection will fail.

If more lax security is preferred, the wildcard value * may be used to allow impersonation from any host or of any user. For example, by specifying as below in core-site.xml, user named oozie accessing from any host can impersonate any user belonging to any group.


hadoop.proxyuser.oozie.hosts
*


hadoop.proxyuser.oozie.groups
*

The hadoop.proxyuser.$superuser.hosts accepts list of ip addresses, ip address ranges in CIDR format and/or host names. For example, by specifying as below, user named super accessing from hosts in the range 10.222.0.0-10.222.255.255 and 10.113.221.221 can impersonate user1 and user2.


hadoop.proxyuser.super.hosts
10.222.0.0/16,10.113.221.221


hadoop.proxyuser.super.users
user1,user2

你可能感兴趣的:(使用jdbc连接hive报错:java.lang.RuntimeException: org.apache.hadoop.ipc.RemoteException(org.apache.hadoo...)