I have below code. This does the renewal right?. What I am not getting is, How drivermanager know this config/user to use when establishing connection?
UserGroupInformation.setConfiguration(conf); if (loginUser == null) { UserGroupInformation.loginUserFromKeytab(keytabPrincipal, keytabLocation) loginUser = UserGroupInformation.getLoginUser(); } else { loginUser.checkTGTAndReloginFromKeytab(); } con = DriverManager .getConnection("jdbc:hive2://xxxxx:10000/abc;principal=hive/<hostname>@<xx.com>"); stmt = con.createStatement(); Thanks, Chandra From: Vaibhav Gumashta [mailto:vgumas...@hortonworks.com] Sent: Thursday, February 26, 2015 2:03 AM To: user@hive.apache.org Subject: Re: GSS initiate failed exception Looks like your Kerberos authentication failed. Did you renew the ticket? Typical expiry is 24 hours. From: <Bogala>, Chandra Reddy <chandra.bog...@gs.com<mailto:chandra.bog...@gs.com>> Reply-To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>> Date: Wednesday, February 25, 2015 at 3:42 AM To: "user@hive.apache.org<mailto:user@hive.apache.org>" <user@hive.apache.org<mailto:user@hive.apache.org>> Subject: GSS initiate failed exception Hi, My Hive jdbc client queries ( hiveserver2) to secured cluster fails with below exception after one or two days running fine from tomcat. Any idea what might be the issue? Is it a known issue? 2015-02-25 04:49:43,174 ERROR [org.apache.thrift.transport.TSaslTransport] SASL negotiation failure javax.security.sasl.SaslException: GSS initiate failed at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:212) ~[na:1.7.0_06] at org.apache.thrift.transport.TSaslClientTransport.handleSaslStartMessage(TSaslClientTransport.java:94) [hive-exec-0.13.0.jar:0.13.0] ------ --------------------- Caused by: org.apache.thrift.transport.TTransportException: GSS initiate failed at org.apache.thrift.transport.TSaslTransport.sendAndThrowMessage(TSaslTransport.java:221) at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:297) at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37) at org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport$1.run(TUGIAssumingTransport.java:52) at org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport$1.run(TUGIAssumingTransport.java:49) at java.security.AccessController.doPrivileged(Native Method) at javax.security.auth.Subject.doAs(Subject.java:415) at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1491) at org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport.open(TUGIAssumingTransport.java:49) at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:203) Thanks, Chandra