2016-11-10 2 views
0

ハイブに接続するためにケルベロスを偽装しようとしていますが、gss init例外が発生しています。Hive(Beeline)用の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プロキシユーザーの設定を解除すると、最初に設定を解除しないとbeelが失敗します