Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 5D932200B63 for ; Mon, 1 Aug 2016 00:12:10 +0200 (CEST) Received: by cust-asf.ponee.io (Postfix) id 5C41D160AA9; Sun, 31 Jul 2016 22:12:10 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id A469F160A81 for ; Mon, 1 Aug 2016 00:12:09 +0200 (CEST) Received: (qmail 48950 invoked by uid 500); 31 Jul 2016 22:12:08 -0000 Mailing-List: contact commits-help@hive.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: hive-dev@hive.apache.org Delivered-To: mailing list commits@hive.apache.org Received: (qmail 48939 invoked by uid 99); 31 Jul 2016 22:12:08 -0000 Received: from git1-us-west.apache.org (HELO git1-us-west.apache.org) (140.211.11.23) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 31 Jul 2016 22:12:08 +0000 Received: by git1-us-west.apache.org (ASF Mail Server at git1-us-west.apache.org, from userid 33) id B014CE1101; Sun, 31 Jul 2016 22:12:08 +0000 (UTC) Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: ctang@apache.org To: commits@hive.apache.org Message-Id: <7c8790616ca549ec99dd9c1b7a477243@git.apache.org> X-Mailer: ASF-Git Admin Mailer 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 +0000 (UTC) archived-at: Sun, 31 Jul 2016 22:12:10 -0000 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 Authored: Sun Jul 31 18:11:04 2016 -0400 Committer: ctang 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 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) {