我正在尝试使用JDBC驱动程序从本地Java应用程序连接到配置单元,但出现错误:
Exception in thread "main" java.sql.SQLException: Could not open client transport with JDBC Uri: <url>: GSS initiate failed
代码段:
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);
我对此很陌生,因此如果这是一个愚蠢的问题,我会提前道歉,但是如何指定krb5.conf位置或仅使用凭据高速缓存中的内容呢?
我尝试设置系统属性,但是这也不起作用:
System.setProperty("java.security.krb5.conf", "krb5_location");
任何帮助将不胜感激。谢谢!