Support Questions

Find answers, ask questions, and share your expertise
Announcements
Celebrating as our community reaches 100,000 members! Thank you!

[Cloudera][HiveJDBCDriver](500593) Communication link failure. Failed to connect to server. Reason: Socket is closed by peer.

avatar

hi community cloudera, 

i'm experiencing strange hive drive behaviour:

my app consequently performing `select` queries on multiple tables successfully. But at some point it gets an error:

 

java.sql.SQLException: [Cloudera][HiveJDBCDriver](500593) Communication link failure. Failed to connect to server. Reason: Socket is closed by peer. FetchResults for query "SELECT `iq***".
 
and when the app retries to reconnect (because java.sql.Connection.isValid() == false)
it constantly gets 
 
[Cloudera][JDBC](10060) Connection has been closed.
java.sql.SQLNonTransientConnectionException: [Cloudera][JDBC](10060) Connection has been closed.
at com.cloudera.hiveserver2.exceptions.ExceptionConverter.toSQLException(Unknown Source)
at com.cloudera.hiveserver2.jdbc.common.SConnection.closeConnection(Unknown Source)
at com.cloudera.hiveserver2.jdbc.common.SConnection.abortInternal(Unknown Source)
at com.cloudera.hiveserver2.jdbc.common.SConnection.close(Unknown Source)
 
Since connection string is 
jdbc:hive2://hive2host.loc:10000;AuthMech=3
 
I don't have access to Hive logs, so I can guess only.
Could it be relates to LDAP server issues? Or it is by some other reason? 
 
 
 
7 REPLIES 7

avatar
Community Manager

@denysobukhov, Welcome to our community! To help you get the best possible answer, I have tagged in our HIve experts @asish @smruti @tjangid @ggangadharan  who may be able to assist you further.

Please feel free to provide any additional information or details about your query, and we hope that you will find a satisfactory solution to your question.



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.
Learn more about the Cloudera Community:

avatar

the query is 

SELECT `iqrowkey`, `niu1`, `nif1`, `nombre1`, `niu2`, `nif2`, `nombre2`, `conyuge`, `exconyuge`, `ascendiente`, `descendiente`, `xd003`, `xfsinergi`, `xd001`, `xd0011` FROM `rstg_pro`.`rstg`

avatar
Guru

hi @denysobukhov  Is your cluster SSL and LDAP enabled?

Are you able to connect from beeline?

Please review https://community.cloudera.com/t5/Community-Articles/How-to-Connect-to-Hiveserver2-Using-Cloudera-JD... and change it as per the usage.

avatar

it's customers server and I don't have access to shell 

avatar
Rising Star

@denysobukhov 

Confirm the JDBC version you are trying to connect? Try upgrading to the latest version https://www.cloudera.com/downloads/connectors/hive/jdbc/2-6-25.html 

If the above didn't help please attach the TRACE level driver logs. Refer https://docs.cloudera.com/documentation/other/connectors/hive-jdbc/2-6-25/Cloudera-JDBC-Connector-fo... page# 103.

avatar

i'm using 

HiveJDBC42 2.6.25.1033

i'll try TRACE log level

avatar
Contributor

@denysobukhov 
Based on error stack trace which you have shared looks like the connection is getting closed before fetching the results for the query.
Is there a delay between submitting the query and then receiving the error? If yes, what is the delay exactly.
During the time of error appears,have you observe any alerts from HS2 ?
Are you able to  connect to HS2 from beeline without any issue during the time of  failure?
Is hive2host.loc is the loadbalancer URL?
We might require the JDBC TRACE LOGS and HS2 logs to determine the cause  of failure.

Thank You.