Support Questions

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

how to use 'HS2Driver' driver class to connect cdh hive with kerberos

avatar
New Contributor

driver class: com.cloudera.hive.jdbc.HS2Driver

jar : HiveJDBC42-2.6.11.1014

the kerberos needs a keytab file, i wonder if this can be set by 'org.apache.hadoop.security.UserGroupInformation' class

 

thks.

1 ACCEPTED SOLUTION

avatar
Super Collaborator

@sevens You might want to use latest version: 2.6.21 and also there is no hard limit to use UGI with Cloudera Driver as opposed to Apache Drivers.

 

One option is to use JAAS file like below.

client.jaas

 

Client {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
keyTab="PathToTheKeyTab"
principal="cloudera@CLOUDERA"
doNotPrompt=true;
};

 

 and set the java.security.auth.login.config system property to the location of the JAAS file.

eg: java -Djava.security.auth.login.config=/opt/clientconf/client.jaas

 

Doc ref: https://docs.cloudera.com/documentation/other/connectors/hive-jdbc/2-6-21/Cloudera-JDBC-Connector-fo...

View solution in original post

3 REPLIES 3

avatar
Community Manager

@sevens Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our Hive experts @Shmoo  and  @mszurap  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.


Regards,

Diana Torres,
Community Moderator


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
Super Collaborator

@sevens You might want to use latest version: 2.6.21 and also there is no hard limit to use UGI with Cloudera Driver as opposed to Apache Drivers.

 

One option is to use JAAS file like below.

client.jaas

 

Client {
com.sun.security.auth.module.Krb5LoginModule required
useKeyTab=true
keyTab="PathToTheKeyTab"
principal="cloudera@CLOUDERA"
doNotPrompt=true;
};

 

 and set the java.security.auth.login.config system property to the location of the JAAS file.

eg: java -Djava.security.auth.login.config=/opt/clientconf/client.jaas

 

Doc ref: https://docs.cloudera.com/documentation/other/connectors/hive-jdbc/2-6-21/Cloudera-JDBC-Connector-fo...

avatar
New Contributor

 

thks!