Our Community is getting an upgrade! To get everything ready for the relaunch, we’ll be placing the site in read-only mode starting September 21st.
We really appreciate your understanding while we get things set up behind the scenes. Catch up on all the exciting details about the move here.
Need help or have questions? Drop us a line at [email protected]

Support Questions

Find answers, ask questions, and share your expertise
Announcements
Share your experience with Cloudera on G2 and get a $25 Amazon Gift card.
Hi, I'm CLEO! Something exciting is coming to the Community. Stay Tuned!

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

avatar
Frequent Visitor

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,
Senior 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
Frequent Visitor

 

thks!