Gaurang Shah
Gaurang Shah

Reputation: 12910

Hive connection to dbvisualizer using Kerberos Authentication

I am using windows machine and trying to setup hive with DbVisualizer using hive uber jar. However getting the error as mentioed below. Not sure why ? https://github.com/timveil/hive-jdbc-uber-jar

I am using following exe to generate keytab file on windows. http://web.mit.edu/KERBEROS/dist/index.html

And All the steps mentioned on the github page.

If I use user principal, I am getting following error.

dbc:hive2://aaa.corp.ad.abc:2181,bbbb.corp.ad.abc:2181,ccc.corp.ad.abc:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;[email protected]

Error Message

Long Message:
Kerberos principal should have 3 parts: [email protected]

Details:
   Type: java.lang.IllegalArgumentException

Stack Trace:
java.lang.IllegalArgumentException: Kerberos principal should have 3 parts: [email protected]
   at org.apache.hive.service.auth.KerberosSaslHelper.getKerberosTransport(KerberosSaslHelper.java:48)
   at org.apache.hive.jdbc.HiveConnection.createBinaryTransport(HiveConnection.java:425)
   at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:202)
   at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:166)
   at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
   at sun.reflect.GeneratedMethodAccessor69.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
   at java.lang.reflect.Method.invoke(Unknown Source)
   at com.onseven.dbvis.g.B.D.ā(Z:1548)
   at com.onseven.dbvis.g.B.F$A.call(Z:1369)
   at java.util.concurrent.FutureTask.run(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor.runWorker(Unknown Source)
   at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)
   at java.lang.Thread.run(Unknown Source)

And if I use server principal as mentioned below error is different.

dbc:hive2://aaa.corp.ad.abc:2181,bbbb.corp.ad.abc:2181,ccc.corp.ad.abc:2181/;serviceDiscoveryMode=zooKeeper;zooKeeperNamespace=hiveserver2;principal=krbgt/[email protected]

Error:

Long Message:
Could not open client transport for any of the Server URI's in ZooKeeper: GSS initiate failed

Details:
   Type: java.sql.SQLException
   SQL State: 08S01

Upvotes: 1

Views: 1916

Answers (1)

Gaurang Shah
Gaurang Shah

Reputation: 12910

Answer provided by Samson in the comment worked for me.

using prinicpal as hive/[email protected] resolved the issue.

Upvotes: 1

Related Questions