Reply
New Contributor
Posts: 1
Registered: ‎08-01-2017

dbVisualizer to be used for querying hive but getting error while accessing Hive metastore tables

Hi Everyone,

 

Sub: dbVisualizer to be used for querying hive tables


I have setup Kerberos(MIT) Authentication.
I have downloaded hive jdbc jars (hive_jdbc_2.5.17.1047) from cloudera connectors.
I tired to connect Hive metastore tables though DbVisualizer using Kerberos Authentication mechanism but getting below errors in dbVisualizer.

 

I tried with different hive JDBC urls and still getting errors

 

1. jdbc:hive2://<Servername.domain.com>:10000;
2 jdbc:hive2://<Servername.domain.com>:10000/default;principal=hive/<Servername2.domain.com>@HADOOP.yyy.XXXX.COM
3. jdbc:hive2://<Servername.domain.com>:10000;AuthMech=1;KrbRealm=HADOOP.yyy.XXXX.COM;KrbHostFQDN=<Servername2.domain.com>;KrbServiceName=hive

 

 

Error:

Log:

1.

2017-07-24 11:24:25.462 INFO 154 [ExecutorRunner-pool-3-thread-2 - H.?] Exception while connecting Hive2
java.sql.SQLException: [Cloudera][HiveJDBCDriver](500164) Error initialized or created transport for authentication: java.net.ConnectException: Connection timed out: connect.
at com.cloudera.hiveserver2.hivecommon.api.HiveServer2ClientFactory.createTransport(Unknown Source)
Caused by: com.cloudera.hiveserver2.support.exceptions.GeneralException: [Cloudera][HiveJDBCDriver](500164) Error initialized or created transport for authentication:
java.net.ConnectException: Connection timed out: connect.

 

2.

[Cloudera][HiveJDBCDriver](500164) Error initialized or created transport for authentication: Peer indicated failure: Unsupported mechanism type PLAIN 

 

 

 

 

Posts: 376
Topics: 11
Kudos: 58
Solutions: 32
Registered: ‎09-02-2016

Re: dbVisualizer to be used for querying hive but getting error while accessing Hive metastore table

@NarasimhaSomu

 

Make sure you have the below highlighted principal (servername instead of servername2) in the kerberos and try again

 

jdbc:hive2://<Servername.domain.com>:10000/default;principal=hive/<Servername.domain.com>@HADOOP.yyy.XXXX.COM

Posts: 642
Topics: 3
Kudos: 103
Solutions: 67
Registered: ‎08-16-2016

Re: dbVisualizer to be used for querying hive but getting error while accessing Hive metastore table

1. is for unsecured access
2. is for the Hive JDBC driver and looks mostly correct (comment below)
3. is for the Cloudera Hive JDBC driver

JDBC connections will always be to the HS2 and not HMS. The hostname portion of the principal needs to be the FQDN of the HS2 server you are connecting to.

Try the URI below.

jdbc:hive2://<Servername.domain.com>:10000;AuthMech=1;KrbRealm=HADOOP.yyy.XXXX.COM;KrbHostFQDN=<Servername.domain.com>;KrbServiceName=hive
Announcements