Reply
Explorer
Posts: 33
Registered: ‎07-15-2015

Kerberos tickets failing to renew through java code for long running jobs

Hi,

 

We are unable to renew kerberos user tickets from keytab using java code, while it's working with "kinit -R"

code:

 

UserGroupInformation loginUser = UserGroupInformation.getLoginUser(); loginUser.checkTGTAndReloginFromKeytab();

 

 Please help me out.

Posts: 388
Topics: 11
Kudos: 60
Solutions: 34
Registered: ‎09-02-2016

Re: Kerberos tickets failing to renew through java code for long running jobs

@RakeshE

 

you don't need to renew kerberos ticket from java code instead you can create a shell script with kinit and call it from a cron job. you can also schedule this cron once in 24 hrs or 23.59 hrs (based on your ticket validity period). so that your long running job will run without any issue

Explorer
Posts: 33
Registered: ‎07-15-2015

Re: Kerberos tickets failing to renew through java code for long running jobs

[ Edited ]

Thanks for your reply @saranvisa. But we are running some jobs through Java code and we should not get the Kerberos login tickets from os level as the different Kerberos users will log into the severs os level.So we are trying to login Kerberos user with keytab through Java for a specific job

Highlighted
Posts: 388
Topics: 11
Kudos: 60
Solutions: 34
Registered: ‎09-02-2016

Re: Kerberos tickets failing to renew through java code for long running jobs

@RakeshE

 

In general the option that i've mentioned is the default method. You have to work with your hadoop/unix admin to setup a cron job for your key tab.

 

I don't think controlling kerberos ticket from java code is a good option. Because you have to do this for all your jobs... it is not recommended.  forget about different kerbeors users as long as your team (or) batchid has a dedicated keytab file but if the different kerbeors user is also using your keytab then the ticket validity is common for both of you

Announcements

Currently incubating in Cloudera Labs:

Envelope
HTrace
Ibis
Impyla
Livy
Oryx
Phoenix
Spark Runner for Beam SDK
Time Series for Spark
YCSB