Created on 07-29-2016 10:11 PM - edited 08-18-2019 05:16 AM
In my HDP 2.3.2 Sandbox with no authorization for HiveServer2, I'm attempting to enable http mode, but connections are being "refused". See error thrown by beeline.
[root@sandbox ~]# beeline -u jdbc:hive2://sandbox.hortonworks.com:10001/default;transportMode=http;httpPath=cliservice
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/spark/lib/spark-assembly-1.4.1.2.3.2.0-2950-hadoop2.7.1.2.3.2.0-2950.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
WARNING: Use "yarn jar" to launch YARN applications.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/spark/lib/spark-assembly-1.4.1.2.3.2.0-2950-hadoop2.7.1.2.3.2.0-2950.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Connecting to jdbc:hive2://sandbox.hortonworks.com:10001/default
Error: Could not open client transport with JDBC Uri: jdbc:hive2://sandbox.hortonworks.com:10001/default: java.net.ConnectException: Connection refused (state=08S01,code=0)
Beeline version 1.2.1.2.3.2.0-2950 by Apache Hive
0: jdbc:hive2://sandbox.hortonworks.com:10001 (closed)>
Created 07-31-2016 12:13 AM
PEBCAK! After restarting Hive services a couple of times, and then surrounding my URI with single quotes, it appears all good.
First, made sure port 10001 is listening ...
[root@sandbox hive]# netstat -tulpna|grep 10001
tcp 0 0 0.0.0.0:10001 0.0.0.0:* LISTEN 25819/java
Then, attempted to connect with URI ...
beeline -u jdbc:hive2://sandbox.hortonworks.com:10001/default;transportMode=http;httpPath=cliservice
Finally, succeeded with URI ...
beeline -u 'jdbc:hive2://sandbox.hortonworks.com:10001/default;transportMode=http;httpPath=cliservice'
Created 07-29-2016 10:15 PM
Is your cluster Kerberos?
!connect jdbc:hive2://beeline.server.example.com:10001/default;principal=hive/beeline.server.example.com@KRB_DOMAIN.EXAMPLE.COM;transportMode=http;httpPath=cliservice
The parts to note:
Created 07-29-2016 10:18 PM
Nope. It's just an HDP Sandbox. No authorization for Hive. No Kerberos at all.
Created 07-29-2016 10:20 PM
Can you please upload hive logs?
Created 07-29-2016 10:36 PM
Sorry, rather than searching it's probably faster to ask which logs you're looking for? Where can I find them?
Created 07-29-2016 10:46 PM
you can find hiveserver2.log under /var/log/hive directory.
Created 07-29-2016 11:00 PM
Doesn't appear to have much info, but maybe you can make something of this, hive.zip. Thanks!
Created 07-30-2016 07:34 PM
Is your hiveserver2 listening on 10001? You can test it by running netstat command on HS2 server
netstat -tulpna|grep 10001
Created 07-30-2016 11:49 PM
[root@sandbox ~]# netstat -tulpna|grep 10001
tcp 0 0 0.0.0.0:10001 0.0.0.0:* LISTEN 3478/java
tcp 0 0 10.211.55.5:42224 10.211.55.5:10001 TIME_WAIT -
Created 07-31-2016 12:02 AM
BTW ... getting a different error right now. I'll try to troubleshoot it.
[root@sandbox hive]# netstat -tulpna|grep 10001
tcp 0 0 0.0.0.0:10001 0.0.0.0:* LISTEN 3478/java
tcp 0 0 10.211.55.5:43108 10.211.55.5:10001 TIME_WAIT -
[root@sandbox hive]# beeline -u jdbc:hive2://localhost:10001/default;transportMode=http;httpPath=cliservice
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/spark/lib/spark-assembly-1.4.1.2.3.2.0-2950-hadoop2.7.1.2.3.2.0-2950.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
WARNING: Use "yarn jar" to launch YARN applications.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/spark/lib/spark-assembly-1.4.1.2.3.2.0-2950-hadoop2.7.1.2.3.2.0-2950.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/2.3.2.0-2950/hadoop/lib/slf4j-log4j12-1.7.10.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation.
SLF4J: Actual binding is of type [org.slf4j.impl.Log4jLoggerFactory]
Connecting to jdbc:hive2://localhost:10001/default
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10001/default: Invalid status 72 (state=08S01,code=0)
Beeline version 1.2.1.2.3.2.0-2950 by Apache Hive
0: jdbc:hive2://localhost:10001/default (closed)>