Skip to main content
Nur
Silver ⭐️
February 27, 2023
Solved

ERROR: Connecting to Kerberos Enabled Hive using Beeline Connection String

Hello,

I am unable to access Hive using Beeline connection string in the edge node. The JDBC String that I am using is as follows:

beeline -u "jdbc:hive2://Example.com:10000/default;principal=hive/Example.com@EXAMPLE.COM"

 

Error:

Unknown HS2 problem when communicating with Thrift server.
Error:jdbc:hive2://Example.com:10000/default;principal=hive/Example.com@EXAMPLE.COM: Invalid status 21 (state=08S01,code=0)

Help is required to fix this issue.

 

Thank you.

 

asish
asishAnswer
Gold ⭐️⭐️⭐️
February 27, 2023

I see that you are using CDP 7.1.7. Follow below steps if youare using autoTLS

1. Check TrustStore Password:
======
# cat /etc/hive/conf/ssl-client.xml | grep -i -A1 "ssl.client.truststore.password"
<name>ssl.client.truststore.password</name>
<value>truststore_password</value>
======


2. Below should be used for Kerberos + SSL
beeline -u "jdbc:hive2://xxxxxx10000/default;principal=hive/xxxxx@CREAL;ssl=true;sslTrustStore=/var/lib/cloudera-scm-agent/agent-cert/cm-auto-global_truststore.jks;trustStorePassword=trsutpwd"

6 replies

asish
Gold ⭐️⭐️⭐️
Gold ⭐️⭐️⭐️
February 27, 2023

 

@Nur 

 

1. are you using SSL ?

2. Provide

beeline -u "jdbc:hive2://Example.com:10000/default;principal=hive/Example.com@EXAMPLE.COM" --berbose=true

 

3. Hiveserver2 logs

 

Translate
Nur
NurAuthor
Silver ⭐️
February 27, 2023

1. Yes Iam using ssl

2. In below image have provided the output from the connection string

Nur_0-1677495893240.png

3. Have provided the SS for the log file in the below image.

Nur_1-1677497072695.png

 

Translate
asish
Gold ⭐️⭐️⭐️
asishAnswer
Gold ⭐️⭐️⭐️
February 27, 2023

I see that you are using CDP 7.1.7. Follow below steps if youare using autoTLS

1. Check TrustStore Password:
======
# cat /etc/hive/conf/ssl-client.xml | grep -i -A1 "ssl.client.truststore.password"
<name>ssl.client.truststore.password</name>
<value>truststore_password</value>
======


2. Below should be used for Kerberos + SSL
beeline -u "jdbc:hive2://xxxxxx10000/default;principal=hive/xxxxx@CREAL;ssl=true;sslTrustStore=/var/lib/cloudera-scm-agent/agent-cert/cm-auto-global_truststore.jks;trustStorePassword=trsutpwd"

Translate
VidyaSargur
Community Manager
Community Manager
March 3, 2023

@Nur, Have the replies helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.  

Translate
Regards, Vidya Sargur, Community Manager Was your question answered? Make sure to mark the answer as the accepted solution. If you find a reply useful, say thanks by clicking on the thumbs up button.
bish765485
Silver ⭐️⭐️
September 26, 2024

Hey Guys,

I am also facing the same error while connecting via beeline with ssl and kerberos on the server:
root@ip-172-31-13-77:~# beeline -u jdbc:hive2://ec2-52-66-58-15.ap-south-1.compute.amazonaws.com:10000/default;principal=hive/ec2-52-66-58-15.ap-south-1.compute.amazonaws.com@AP-SOUTH-1.COMPUTE.AMAZONAWS.COM;saslqop=auth-conf
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p0.15945976/jars/log4j-slf4j-impl-2.13.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p0.15945976/jars/slf4j-log4j12-1.7.30.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.apache.logging.slf4j.Log4jLoggerFactory]
WARNING: Use "yarn jar" to launch YARN applications.
SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p0.15945976/jars/log4j-slf4j-impl-2.13.3.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/opt/cloudera/parcels/CDH-7.1.7-1.cdh7.1.7.p0.15945976/jars/slf4j-log4j12-1.7.30.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.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://ec2-52-66-58-15.ap-south-1.compute.amazonaws.com:10000/default
24/09/26 11:44:18 [main]: WARN jdbc.HiveConnection: Failed to connect to ec2-52-66-58-15.ap-south-1.compute.amazonaws.com:10000
Unknown HS2 problem when communicating with Thrift server.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://ec2-52-66-58-15.ap-south-1.compute.amazonaws.com:10000/default: Invalid status 21 (state=08S01,code=0)

Please connect with someone expert on this  domain and get me correct .
Thanks in advance

Ankit Bishnoi

Translate
bish765485
Silver ⭐️⭐️
September 27, 2024

Any there from cloudera to help me on this issue.....

Translate