我试图模拟kerberos以连接到配置单元,但它给出了gss init异常。
UserGroupInformation ugi = kinit.generateKerberosTicket(configResources, keytab, principal);
serGroupInformation ugiProxy = UserGroupInformation.createProxyUser("shashi", ugi.getCurrentUser());
ugiProxy.doAs( new PrivilegedExceptionAction<Void>(){
@Override
public Void run() throws Exception {
Connection con = DriverManager.getConnection("jdbc:hive2://quickstart.cloudera:10000/default;principal=hive/quickstart.cloudera@CLOUDERA", "shashi", "");
Statement stmt = con.createStatement();
String sql = "show databases ";
ResultSet res = stmt.executeQuery(sql);
if (res.next()) {
System.out.println("DB names ---- >" +res.getString(1));
}
makeHiveJdbcConnection();
return null;
}
但有以下例外。
java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://quickstart.cloudera:10000/default;principal=hive/quickstart.cloudera@CLOUDERA: GSS initiate failed
关于这个问题有什么线索吗?
1条答案
按热度按时间pu3pd22g1#
先取消设置hadoop代理用户,如果不先取消设置,beeline将失败