Support Questions

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

Ways to specify Kerberos authentication in a JDBC URL for Hive connection?

avatar
New Contributor

I'm trying to connect to Hive via JDBC, authenticated by Kerberos. I'm not connecting through custom Java code where I could just call UserGroupInformation.loginUserFromKeytab prior to establishing the connection; rather, I'm connecting through an SQL tool that uses JDBC drivers to connect, and my options to provide authentication information are rather limited to JDBC URL itself, and its connection properties. Is there a way to specify the Kerberos authentication there?

5 REPLIES 5

avatar
Master Mentor

@Alex Savitsky

Following HCC Article provides Various examples of HiveSerevr2 connection:

https://community.hortonworks.com/articles/4103/hiveserver2-jdbc-connection-url-examples.html

avatar
New Contributor

Yes, I've seen this article, and it specifically notes that "The client is required to 'kinit' before connecting through JDBC" - this might be fine for a custom code, but not for a tool, where one doesn't have control of what happens before the connection.

avatar
Master Mentor

@Alex Savitsky

The Kerberos ticket is not specific to the "Client".

So as long as the user who is running the SQL tool has a valid ticket created already before running the query, Should be able to access the Hive.

The common utility to create get the kerberos ticket is "kinit" . It is not necessary that the Tool that we are using will have to create create the kerberos ticket.

.

avatar
Master Mentor

@Alex Savitsky

Following is a Blog link which shows how to configure SQL Developer tool to setup keytool. (but "kinit" we will need to do manually)

https://db-blog.web.cern.ch/blog/prasanth-kothuri/2016-02-using-sql-developer-access-apache-hive-ker...

avatar
New Contributor

Alex,

Did you find any solution for this? i also have similar requirement to connect to JDBC through Kerberos.