2016-11-10 43 views
0

我想模擬kerberos爲了連接到配置單元,但它給了gss初始化異常。爲Hive(直線)Kerberos模擬

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/[email protected]", "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/[email protected]: GSS initiate failed 

這個問題的任何線索?

回答

0

首先取消hadoop代理用戶的設置,如果先不取消設置,直線會失敗