I am trying to connect to hive from my local java application using JDBC driver but am getting an error:
Exception in thread "main" java.sql.SQLException: Could not open client transport with JDBC Uri: <url>: GSS initiate failed
Code snippet:
org.apache.hadoop.conf.Configuration conf = new
org.apache.hadoop.conf.Configuration();
conf.set("hadoop.security.authentication", "Kerberos");
UserGroupInformation.setConfiguration(conf);
UserGroupInformation.loginUserFromKeytab("principal", "keytab_location");
Class.forName("org.apache.hive.jdbc.HiveDriver");
Connection conn = DriverManager.getConnection(url);
I am fairly new to this so I apologize in advance if this is a stupid question, but how can I specify the krb5.conf location or to simply use what is in the credentials cache?
I have tried to set system properties but that did not work either:
System.setProperty("java.security.krb5.conf", "krb5_location");
Any help is greatly appreciated. Thanks!