private static void setUpZooKeeperAuth(HiveConf hiveConf) throws Exception {
    if (ZookeeperUtils.isKerberosEnabled(hiveConf)) {
      String principal = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL);
      if (principal.isEmpty()) {
        throw new IOException("HiveServer2 Kerberos principal is empty");
      }
      String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB);
      if (keyTabFile.isEmpty()) {
        throw new IOException("HiveServer2 Kerberos keytab is empty");
      }
      // Install the JAAS Configuration for the runtime
      Utils.setZookeeperClientKerberosJaasConfig(principal, keyTabFile);
    }
  }
For a kerberized cluster, we dynamically set up the client's JAAS conf.

@param hiveConf
@return
@throws Exception
service/src/java/org/apache/hive/service/server/HiveServer2.java