test-wangxiaoyu commented on a change in pull request #3622:
URL: https://github.com/apache/hudi/pull/3622#discussion_r704900355



##########
File path: 
hudi-sync/hudi-hive-sync/src/main/java/org/apache/hudi/hive/HiveSyncTool.java
##########
@@ -77,6 +77,10 @@ public HiveSyncTool(HiveSyncConfig cfg, HiveConf 
configuration, FileSystem fs) {
     super(configuration.getAllProperties(), fs);
 
     try {
+      if (cfg.useKerberos) {
+        configuration.set("hive.metastore.sasl.enabled", "true");
+        configuration.set("hive.metastore.kerberos.principal", 
cfg.kerberosPrincipal);

Review comment:
       You can test kerberos in this way  
   Method KerberosLogin.login() performs Kerberos authentication on the client
     public static void test() {
           KerberosLogin.login();
           HiveConf conf = new HiveConf();
           conf.set("metastore.thrift.uris", "thrift://ip:9083");
           conf.set("hive.metastore.kerberos.principal", "xxxxxxxxx");
           conf.set("hive.metastore.sasl.enabled", "true");
           try {
               IMetaStoreClient msc = Hive.get(conf).getMSC();
               boolean b = msc.tableExists("test", "a_message_info_test");
               System.out.println(b);
           } catch (MetaException e) {
               e.printStackTrace();
           } catch (HiveException e) {
               e.printStackTrace();
           } catch (UnknownDBException e) {
               e.printStackTrace();
           } catch (TException e) {
               e.printStackTrace();
           }
       }




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to