hive-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ct...@apache.org
Subject hive git commit: HIVE-14383: SparkClientImpl should pass principal and keytab to spark-submit instead of calling kinit explicitely (Chaoyu Tang, reviewed by Xuefu Zhang)
Date Sun, 31 Jul 2016 22:12:08 GMT
Repository: hive
Updated Branches:
  refs/heads/branch-2.1 89ce41d81 -> a138408fb


HIVE-14383: SparkClientImpl should pass principal and keytab to spark-submit instead of calling
kinit explicitely (Chaoyu Tang, reviewed by Xuefu Zhang)


Project: http://git-wip-us.apache.org/repos/asf/hive/repo
Commit: http://git-wip-us.apache.org/repos/asf/hive/commit/a138408f
Tree: http://git-wip-us.apache.org/repos/asf/hive/tree/a138408f
Diff: http://git-wip-us.apache.org/repos/asf/hive/diff/a138408f

Branch: refs/heads/branch-2.1
Commit: a138408fb9ebcc67f08826298f54b1ce82234cda
Parents: 89ce41d
Author: ctang <ctang@cloudera.com>
Authored: Sun Jul 31 18:11:04 2016 -0400
Committer: ctang <ctang@cloudera.com>
Committed: Sun Jul 31 18:11:52 2016 -0400

----------------------------------------------------------------------
 .../hive/spark/client/SparkClientImpl.java      | 21 ++++++++++----------
 1 file changed, 10 insertions(+), 11 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/hive/blob/a138408f/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
----------------------------------------------------------------------
diff --git a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
index 59a31c2..377b24d 100644
--- a/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
+++ b/spark-client/src/main/java/org/apache/hive/spark/client/SparkClientImpl.java
@@ -328,17 +328,6 @@ class SparkClientImpl implements SparkClient {
 
       List<String> argv = Lists.newArrayList();
 
-      if ("kerberos".equalsIgnoreCase(hiveConf.get(HADOOP_SECURITY_AUTHENTICATION))) {
-          argv.add("kinit");
-          String principal = SecurityUtil.getServerPrincipal(hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL),
-              "0.0.0.0");
-          String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB);
-          argv.add(principal);
-          argv.add("-k");
-          argv.add("-t");
-          argv.add(keyTabFile + ";");
-      }
-
       if (sparkHome != null) {
         argv.add(new File(sparkHome, "bin/spark-submit").getAbsolutePath());
       } else {
@@ -376,6 +365,16 @@ class SparkClientImpl implements SparkClient {
         argv.add("org.apache.spark.deploy.SparkSubmit");
       }
 
+      if ("kerberos".equals(hiveConf.get(HADOOP_SECURITY_AUTHENTICATION))) {
+          String principal = SecurityUtil.getServerPrincipal(hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_PRINCIPAL),
+              "0.0.0.0");
+          String keyTabFile = hiveConf.getVar(ConfVars.HIVE_SERVER2_KERBEROS_KEYTAB);
+          argv.add("--principal");
+          argv.add(principal);
+          argv.add("--keytab");
+          argv.add(keyTabFile);
+      }
+
       if (master.equals("yarn-cluster")) {
         String executorCores = conf.get("spark.executor.cores");
         if (executorCores != null) {


Mime
View raw message