Support Questions

Find answers, ask questions, and share your expertise
Announcements
Check out our newest addition to the community, the Cloudera Data Analytics (CDA) group hub.

IMPALA JDBC connection

Explorer

Hi,

  I want to connect Impala through Sql Developer or in general through JDBC way on 21050 port. I installed all thing to connection but I do not how to connect Impala Server to jdbc client.

 

Any suggestion?

 

Regards.

 

Sebastiano.

14 REPLIES 14

Expert Contributor

There is a suggestion:

http://www.cloudera.com/content/cloudera-content/cloudera-docs/Impala/latest/Installing-and-Using-Im...

 

Just follow the white rabbit. It works 100%.

I use this tool: http://www.squirrelsql.org/

Can't say something special about your Sql Developer.

 

 

Can you share steps to setup JDBC connection in SQuirreL ? I am hitting issue while setting it up. And does it work with Keberosized Cluster?

New Contributor

I would also like the steps for SQuirrel.  I'm having trouble getting it connected.

 

Explorer

Hello,

 

I would like to step into this discussion as well.

 

I cannot establish a connection to Impala (impalad version 2.3.0-cdh5.5.1 RELEASE) using the recommended JDBC drivers ("Cloudera_ImpalaJDBC4_2.5.5.1007.zip" - com.cloudera.impala.jdbc4.Driver).

 

Impala is configured to use Sentry for authorization and with the HDFS synchronization plugin activated, otherwise no LDAP and no Kerberos. User - Group mappings are provided by OS.

 

Used connection strings:
jdbc:impala://:21050/;UID=;PWD=;AuthMech=3;auth=noSasl; and
jdbc:impala://:21050/;UID=;PWD=;AuthMech=3; in both cases the client

 

The client never manages to connect to the Impala daemon and each connection attempt results in "Connection time out".

 

Tthe only successful connection is with this string:

jdbc:impala://:21050;AuthMech=0;

but this is not really useful because as anonymous / unauthorized user I have no privileges and the only db that can be accessed is "default" and no operation can be performed


The documentation in "Cloudera - Simba JDBC Driver for Cloudera Impala Install Guide.pdf" is incomplete and contradictory (e.g.undocumented "auth" property, and in the newest version of the guide "Cloudera_ImpalaJDBC41_2.5.31.zip" there are confusing mentions of non-existing licence files "ClouderaClouderaImpalaJDBCDriver.lic")

 

Has anyone succeeded to connect to Impala with Sentry without LDAP/Kerberos?

 

I have also raised an official incident with Cloudera Services on behalf of my customer.

 

Thank you

jaro

Expert Contributor
Hi Jaro,

Have you tried making a connection with the latest version of the JDBC
driver ("impala_jdbc_2.5.31.1051.zip")? Can you check the impalad log files
for any suspicious entries that might be related to the issue?

Thanks and Regards, Lars

Explorer

I am having the very same problem with the latest drivers (impala_jdbc_2.5.31.1051).

 

I can establish connections with AuthMech=0 just fine, but any other setting just fails. Below is the details.

 

Any help much appreciated....

 

Thanks,

Stephan

 

JAVA code snippet:

Connection con = DriverManager.getConnection("jdbc:impala://192.168.56.102:21050;AuthMech=3;SocketTimeout=30;UID=cloudera;PWD=cloudera");

 

Console output

opening transport org.apache.thrift.transport.TSaslClientTransport@2e5c649

Sending mechanism name PLAIN and initial response of length 18

CLIENT: Writing message with status START and payload length 5

CLIENT: Writing message with status COMPLETE and payload length 18

CLIENT: Start message handled

CLIENT: Main negotiation loop complete

CLIENT: SASL Client receiving last message

opening transport org.apache.thrift.transport.TSaslClientTransport@68f7aae2

Sending mechanism name PLAIN and initial response of length 18

CLIENT: Writing message with status START and payload length 5

CLIENT: Writing message with status COMPLETE and payload length 18

CLIENT: Start message handled

CLIENT: Main negotiation loop complete

CLIENT: SASL Client receiving last message

java.sql.SQLException: [Simba][ImpalaJDBCDriver](500176) Error connecting to HiveServer2, please verify connection settings.

at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createTransport(Unknown Source)

at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createClient(Unknown Source)

at com.cloudera.hivecommon.core.HiveJDBCCommonConnection.connect(Unknown Source)

at com.cloudera.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)

at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

Caused by: com.cloudera.support.exceptions.GeneralException: [Simba][ImpalaJDBCDriver](500176) Error connecting to HiveServer2, please verify connection settings.

... 7 more

Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out

at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)

at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)

at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:178)

at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:288)

at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)

at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createTransport(Unknown Source)

at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createClient(Unknown Source)

at com.cloudera.hivecommon.core.HiveJDBCCommonConnection.connect(Unknown Source)

at com.cloudera.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)

Done.

at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at java.sql.DriverManager.getConnection(Unknown Source)

at Main.main(Main.java:17)

Caused by: java.net.SocketTimeoutException: Read timed out

at java.net.SocketInputStream.socketRead0(Native Method)

at java.net.SocketInputStream.socketRead(Unknown Source)

at java.net.SocketInputStream.read(Unknown Source)

at java.net.SocketInputStream.read(Unknown Source)

at java.io.BufferedInputStream.fill(Unknown Source)

at java.io.BufferedInputStream.read1(Unknown Source)

at java.io.BufferedInputStream.read(Unknown Source)

at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)

... 12 more

 

Expert Contributor

Can you post here driver logs, driver version you and the server version you are connecting to?

Explorer

I am using the QuickStart VM 5.7.0 and the JDBC drivers impala_jdbc_2.5.31.1051. Both are very recent.

From the JDBC drivers I am using the JDBC4 driver.

 

I am using this connection string:

Connection con = DriverManager.getConnection("jdbc:impala://10.13.0.111:21050/jde;AuthMech=3;SocketTimeout=10;UID=cloudera;PWD=cloudera;LogLevel=6;LogPath=.");

 

The timeout is here to actually have the app do something - without it it just hangs on this line.

 

My JAVA app generates 3 log files.

ImpalaJDBC_driver.log

May 25 06:52:39.886 TRACE 1 com.cloudera.dsi.core.impl.DSIDriver.getProperty(20): +++++ enter +++++
May 25 06:52:39.892 TRACE 1 com.cloudera.dsi.core.impl.DSIEnvironment.DSIEnvironment(com.cloudera.impala.core.ImpalaJDBCDriver@3f91beef): +++++ enter +++++
May 25 06:52:39.892 TRACE 1 com.cloudera.impala.core.ImpalaJDBCEnvironment.ImpalaJDBCEnvironment(com.cloudera.impala.core.ImpalaJDBCDriver@3f91beef): +++++ enter +++++
May 25 06:52:39.892 TRACE 1 com.cloudera.impala.core.ImpalaJDBCEnvironment.createConnection(): +++++ enter +++++
May 25 06:52:50.216 TRACE 1 com.cloudera.dsi.core.impl.DSIDriver.getProperty(1000): +++++ enter +++++
May 25 06:52:50.217 TRACE 1 com.cloudera.dsi.core.impl.DSIDriver.getProperty(20): +++++ enter +++++
May 25 06:52:50.217 TRACE 1 com.cloudera.dsi.core.impl.DSIEnvironment.DSIEnvironment(com.cloudera.impala.core.ImpalaJDBCDriver@3f91beef): +++++ enter +++++
May 25 06:52:50.217 TRACE 1 com.cloudera.impala.core.ImpalaJDBCEnvironment.ImpalaJDBCEnvironment(com.cloudera.impala.core.ImpalaJDBCDriver@3f91beef): +++++ enter +++++
May 25 06:52:50.217 TRACE 1 com.cloudera.impala.core.ImpalaJDBCEnvironment.createConnection(): +++++ enter +++++

 

Impala_connection_0.log

May 25 06:52:39.913 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.DSIConnection(com.cloudera.impala.core.ImpalaJDBCEnvironment@5010be6): +++++ enter +++++
May 25 06:52:39.913 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(101, Variant[type: TYPE_WSTRING, value: ImpalaJDBC]): +++++ enter +++++
May 25 06:52:39.914 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(139, Variant[type: TYPE_WSTRING, value: User]): +++++ enter +++++
May 25 06:52:39.914 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(22, Variant[type: TYPE_WSTRING, value: Impala]): +++++ enter +++++
May 25 06:52:39.914 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(58, Variant[type: TYPE_WSTRING, value: `]): +++++ enter +++++
May 25 06:52:39.915 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(66, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:39.915 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(68, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:39.915 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(76, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:39.915 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(81, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:39.916 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(83, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:39.916 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(80, Variant[type: TYPE_WSTRING, value: N]): +++++ enter +++++
May 25 06:52:39.922 TRACE 1 com.cloudera.impala.core.ImpalaJDBCConnection.ImpalaJDBCConnection(com.cloudera.impala.core.ImpalaJDBCEnvironment@5010be6): +++++ enter +++++
May 25 06:52:39.956 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.registerWarningListener(com.cloudera.jdbc.common.SWarningListener@41906a77): +++++ enter +++++
May 25 06:52:39.956 TRACE 1 com.cloudera.hivecommon.core.HiveJDBCCommonConnection.updateConnectionSettings(): +++++ enter +++++
May 25 06:52:39.969 TRACE 1 com.cloudera.jdbc.common.CommonCoreUtils.logConnectionFunctionEntrance({AuthMech=Variant[type: TYPE_WSTRING, value: 3], ConnSchema=Variant[type: TYPE_WSTRING, value: jde], DatabaseType=Variant[type: TYPE_WSTRING, value: Impala], HiveServerType=Variant[type: TYPE_WSTRING, value: 2], Host=Variant[type: TYPE_WSTRING, value: 10.13.0.111], LogLevel=Variant[type: TYPE_WSTRING, value: 6], LogPath=Variant[type: TYPE_WSTRING, value: .], Port=Variant[type: TYPE_WSTRING, value: 21050], PWD=Variant[type: TYPE_WSTRING, value: cloudera], SocketTimeout=Variant[type: TYPE_WSTRING, value: 10], UID=Variant[type: TYPE_WSTRING, value: cloudera]}, "Major Version: 2", "Minor Version: 5", "Hot Fix Version: 31", "Build Number: 1051", "java.vendor:Oracle Corporation", "java.version:1.8.0_91", "os.arch:amd64", "os.name:Windows 7", "os.version:6.1", "Runtime.totalMemory:126877696", "Runtime.maxMemory:1862270976", "Runtime.avaialableProcessors:4", URLClassLoader.getURLs(): /C:/Users/stephan.INSIGHTSOFTWARE/workspace/ImpalaTest/bin/, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/commons-codec-1.3.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/commons-logging-1.1.1.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/httpclient-4.1.3.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/httpcore-4.1.3.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/ImpalaJDBC4.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/libfb303-0.9.0.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/libthrift-0.9.0.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/log4j-1.2.14.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/ql.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/slf4j-api-1.5.11.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/slf4j-log4j12-1.5.11.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/TCLIServiceClient.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/zookeeper-3.4.6.jar): +++++ enter +++++
May 25 06:52:50.215 ERROR 1 com.cloudera.exceptions.ExceptionConverter.toSQLException: [Simba][ImpalaJDBCDriver](500176) Error connecting to HiveServer2, please verify connection settings.
java.sql.SQLException: [Simba][ImpalaJDBCDriver](500176) Error connecting to HiveServer2, please verify connection settings.
 at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createTransport(Unknown Source)
 at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createClient(Unknown Source)
 at com.cloudera.hivecommon.core.HiveJDBCCommonConnection.connect(Unknown Source)
 at com.cloudera.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
 at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
Caused by: com.cloudera.support.exceptions.GeneralException: [Simba][ImpalaJDBCDriver](500176) Error connecting to HiveServer2, please verify connection settings.
 ... 7 more
Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
 at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
 at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
 at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:178)
 at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:288)
 at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
 at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createTransport(Unknown Source)
 at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createClient(Unknown Source)
 at com.cloudera.hivecommon.core.HiveJDBCCommonConnection.connect(Unknown Source)
 at com.cloudera.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
 at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at Main.main(Main.java:20)
Caused by: java.net.SocketTimeoutException: Read timed out
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.socketRead(Unknown Source)
 at java.net.SocketInputStream.read(Unknown Source)
 at java.net.SocketInputStream.read(Unknown Source)
 at java.io.BufferedInputStream.fill(Unknown Source)
 at java.io.BufferedInputStream.read1(Unknown Source)
 at java.io.BufferedInputStream.read(Unknown Source)
 at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
 ... 12 more

 

Impala_connection_1.log

May 25 06:52:50.218 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.DSIConnection(com.cloudera.impala.core.ImpalaJDBCEnvironment@3339ad8e): +++++ enter +++++
May 25 06:52:50.218 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(101, Variant[type: TYPE_WSTRING, value: ImpalaJDBC]): +++++ enter +++++
May 25 06:52:50.219 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(139, Variant[type: TYPE_WSTRING, value: User]): +++++ enter +++++
May 25 06:52:50.219 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(22, Variant[type: TYPE_WSTRING, value: Impala]): +++++ enter +++++
May 25 06:52:50.219 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(58, Variant[type: TYPE_WSTRING, value: `]): +++++ enter +++++
May 25 06:52:50.219 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(66, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:50.220 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(68, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:50.221 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(76, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:50.221 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(81, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:50.221 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(83, Variant[type: TYPE_UINT16, value: -1]): +++++ enter +++++
May 25 06:52:50.221 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.setProperty(80, Variant[type: TYPE_WSTRING, value: N]): +++++ enter +++++
May 25 06:52:50.222 TRACE 1 com.cloudera.impala.core.ImpalaJDBCConnection.ImpalaJDBCConnection(com.cloudera.impala.core.ImpalaJDBCEnvironment@3339ad8e): +++++ enter +++++
May 25 06:52:50.222 TRACE 1 com.cloudera.dsi.core.impl.DSIConnection.registerWarningListener(com.cloudera.jdbc.common.SWarningListener@555590): +++++ enter +++++
May 25 06:52:50.222 TRACE 1 com.cloudera.hivecommon.core.HiveJDBCCommonConnection.updateConnectionSettings(): +++++ enter +++++
May 25 06:52:50.223 TRACE 1 com.cloudera.jdbc.common.CommonCoreUtils.logConnectionFunctionEntrance({AuthMech=Variant[type: TYPE_WSTRING, value: 3], ConnSchema=Variant[type: TYPE_WSTRING, value: jde], DatabaseType=Variant[type: TYPE_WSTRING, value: Impala], HiveServerType=Variant[type: TYPE_WSTRING, value: 2], Host=Variant[type: TYPE_WSTRING, value: 10.13.0.111], LogLevel=Variant[type: TYPE_WSTRING, value: 6], LogPath=Variant[type: TYPE_WSTRING, value: .], Port=Variant[type: TYPE_WSTRING, value: 21050], PWD=Variant[type: TYPE_WSTRING, value: cloudera], SocketTimeout=Variant[type: TYPE_WSTRING, value: 10], UID=Variant[type: TYPE_WSTRING, value: cloudera]}, "Major Version: 2", "Minor Version: 5", "Hot Fix Version: 31", "Build Number: 1051", "java.vendor:Oracle Corporation", "java.version:1.8.0_91", "os.arch:amd64", "os.name:Windows 7", "os.version:6.1", "Runtime.totalMemory:126877696", "Runtime.maxMemory:1862270976", "Runtime.avaialableProcessors:4", URLClassLoader.getURLs(): /C:/Users/stephan.INSIGHTSOFTWARE/workspace/ImpalaTest/bin/, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/commons-codec-1.3.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/commons-logging-1.1.1.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/httpclient-4.1.3.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/httpcore-4.1.3.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/ImpalaJDBC4.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/libfb303-0.9.0.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/libthrift-0.9.0.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/log4j-1.2.14.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/ql.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/slf4j-api-1.5.11.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/slf4j-log4j12-1.5.11.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/TCLIServiceClient.jar, /C:/InsightSoftware.com/InquirySuite/ThirdPartyProjects/ikvm/ikvm-7.0.4335.0/compiled%20libs/impala_jdbc_driver/zookeeper-3.4.6.jar): +++++ enter +++++
May 25 06:53:00.364 ERROR 1 com.cloudera.exceptions.ExceptionConverter.toSQLException: [Simba][ImpalaJDBCDriver](500176) Error connecting to HiveServer2, please verify connection settings.
java.sql.SQLException: [Simba][ImpalaJDBCDriver](500176) Error connecting to HiveServer2, please verify connection settings.
 at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createTransport(Unknown Source)
 at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createClient(Unknown Source)
 at com.cloudera.hivecommon.core.HiveJDBCCommonConnection.connect(Unknown Source)
 at com.cloudera.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
 at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
Caused by: com.cloudera.support.exceptions.GeneralException: [Simba][ImpalaJDBCDriver](500176) Error connecting to HiveServer2, please verify connection settings.
 ... 7 more
Caused by: org.apache.thrift.transport.TTransportException: java.net.SocketTimeoutException: Read timed out
 at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:129)
 at org.apache.thrift.transport.TTransport.readAll(TTransport.java:84)
 at org.apache.thrift.transport.TSaslTransport.receiveSaslMessage(TSaslTransport.java:178)
 at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:288)
 at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
 at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createTransport(Unknown Source)
 at com.cloudera.hivecommon.api.HiveServer2ClientFactory.createClient(Unknown Source)
 at com.cloudera.hivecommon.core.HiveJDBCCommonConnection.connect(Unknown Source)
 at com.cloudera.jdbc.common.BaseConnectionFactory.doConnect(Unknown Source)
 at com.cloudera.jdbc.common.AbstractDriver.connect(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at java.sql.DriverManager.getConnection(Unknown Source)
 at Main.main(Main.java:20)
Caused by: java.net.SocketTimeoutException: Read timed out
 at java.net.SocketInputStream.socketRead0(Native Method)
 at java.net.SocketInputStream.socketRead(Unknown Source)
 at java.net.SocketInputStream.read(Unknown Source)
 at java.net.SocketInputStream.read(Unknown Source)
 at java.io.BufferedInputStream.fill(Unknown Source)
 at java.io.BufferedInputStream.read1(Unknown Source)
 at java.io.BufferedInputStream.read(Unknown Source)
 at org.apache.thrift.transport.TIOStreamTransport.read(TIOStreamTransport.java:127)
 ... 12 more

 

Explorer

Hi SHoffmann,

 

given that my customer enjoys paid Cloudera support and I insisted on getting an answer to the problem on behalf of the customer the Cloudera support provided the following answer:

 

JDBC using authentication does not work for the Impala driver

 

There are two workarounds to this only:

1) install LDAP and Kerberos then the JDBC driver will start working

2) use AuthMech=0 (no authentication at all)

If neither of the above is an option for you then you can use ODBC driver which supports plain user/pw authentication

 

Best regards

jaro

Explorer

Hi,

 

thanks for the answer. Neither of the 3 is an option for me. I need to use JDBC without LDAP / Kerberos. According to the official documentation it should work - but it doesnt seem to.

 

Cheers

Explorer

Use Hive JDBC Driver (with port 21050) to connect to Impala. It works fine in non-Kerberized cluster/without authentication.

 

https://www.cloudera.com/documentation/enterprise/5-8-x/topics/impala_jdbc.html

New Contributor

I am trying to use the JDBC driver with AuthMech=2 and pass the UID with no password. It connects using 

transportMode=binary , but doesn't pass the UID or username. I have tried with both the Driver and the DataSource. Any ideas? 

New Contributor

I am having the same problem with the Cloudera drivers.

For connection to Impala (CDH 5.8/5.9) I am using "Apache Hive JDBC standalone driver".

 

Links to jars:
hive-jdbc-2.1.1-standalone.jar
hadoop-common-2.7.3.jar

 

Below you can see an examples of setting connections to Impala.

 

Setup Squirrel connection:

  1. Run SQuirrel and add driver with following parameters:
    - driver name: hive-jdbc-2.1.1
    - class name: org.apache.hive.jdbc.HiveDriver
    - example url: jdbc:hive2://<host>:21050/;auth=noSasl
    - extra class path: <path_to_jars>
  2. Add alias with following parameters:
    - name: impala
    - driver: hive-jdbc-2.1.1
    - username: <your_username>
    - password: <your_password>
  3. Test connection 

 

Setup JMeter connection:

  1. Add jars to classpath
  2. Add "JDBC Connection Configuration" with following parameters:
    - Auto commit: True
    - Database URL: jdbc:hive2://<host>:21050/;auth=noSasl
    - JDBC Driver class: org.apache.hive.jdbc.HiveDriver
    - username: <your_username>
    - password: <your_password>

New Contributor
We have workaround first point is inplace but we have experienced connection establishment issues from webserver to impala with below error. It got fixed itself after couple of hours and would like to know what causes this behavior.

[Simba][ImpalaJDBCDriver](500176) Error connecting to HiveServer2, please verify connection details.

Please help us to understand what causes this issue.

Thank you,
Aj
Take a Tour of the Community
Don't have an account?
Your experience may be limited. Sign in to explore more.