ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From smoha...@apache.org
Subject ambari git commit: AMBARI-18142. Spark thrift server to renew its own ticket (Jianfeng Zhang via smohanty)
Date Mon, 15 Aug 2016 21:35:04 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk d6f1720e8 -> 3e3641d8e


AMBARI-18142. Spark thrift server to renew its own ticket (Jianfeng Zhang via smohanty)


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

Branch: refs/heads/trunk
Commit: 3e3641d8ee3f71feef200802cc19adf2235c8fc6
Parents: d6f1720
Author: Sumit Mohanty <smohanty@hortonworks.com>
Authored: Mon Aug 15 14:34:20 2016 -0700
Committer: Sumit Mohanty <smohanty@hortonworks.com>
Committed: Mon Aug 15 14:34:51 2016 -0700

----------------------------------------------------------------------
 .../SPARK/1.2.1/configuration/spark-env.xml             | 12 ++++++++++++
 .../SPARK/1.2.1/package/scripts/params.py               |  4 ++--
 .../SPARK/1.2.1/package/scripts/spark_service.py        |  5 -----
 .../resources/common-services/SPARK/1.4.1/kerberos.json |  6 ++++++
 .../SPARK2/2.0.0/configuration/spark2-env.xml           | 12 ++++++++++++
 .../common-services/SPARK2/2.0.0/kerberos.json          |  6 ++++++
 .../SPARK2/2.0.0/package/scripts/params.py              |  3 ++-
 .../SPARK2/2.0.0/package/scripts/spark_service.py       |  5 -----
 .../stacks/HDP/2.5/services/SPARK/kerberos.json         |  6 ++++++
 9 files changed, 46 insertions(+), 13 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3641d8/ambari-server/src/main/resources/common-services/SPARK/1.2.1/configuration/spark-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/configuration/spark-env.xml
b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/configuration/spark-env.xml
index 832a8f5..71a42f7 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/configuration/spark-env.xml
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/configuration/spark-env.xml
@@ -69,6 +69,18 @@
     </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
+  <property>
+    <name>hive_kerberos_keytab</name>
+    <value>{{hive_kerberos_keytab}}</value>
+    <description>hive keytab for spark thrift server</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hive_kerberos_principal</name>
+    <value>{{hive_kerberos_principal}}</value>
+    <description>hive principal for spark thrift server</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
   <!-- spark-env.sh -->
   <property>
     <name>content</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3641d8/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py
index e38316b..4e525db 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/params.py
@@ -18,7 +18,7 @@ limitations under the License.
 
 """
 
-
+import socket
 import status_params
 
 from setup_spark import *
@@ -170,7 +170,7 @@ if security_enabled:
     })
 
     hive_kerberos_keytab = config['configurations']['hive-site']['hive.server2.authentication.kerberos.keytab']
-    hive_kerberos_principal = config['configurations']['hive-site']['hive.server2.authentication.kerberos.principal']
+    hive_kerberos_principal = config['configurations']['hive-site']['hive.server2.authentication.kerberos.principal'].replace('_HOST',
socket.getfqdn().lower())
 
 # thrift server support - available on HDP 2.3 or higher
 spark_thrift_sparkconf = None

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3641d8/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/spark_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/spark_service.py
b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/spark_service.py
index 704af68..d2f5ef9 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/spark_service.py
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.2.1/package/scripts/spark_service.py
@@ -76,11 +76,6 @@ def spark_service(name, upgrade_type=None, action=None):
         raise
 
     elif name == 'sparkthriftserver':
-      if params.security_enabled:
-        hive_principal = params.hive_kerberos_principal.replace('_HOST', socket.getfqdn().lower())
-        hive_kinit_cmd = format("{kinit_path_local} -kt {hive_kerberos_keytab} {hive_principal};
")
-        Execute(hive_kinit_cmd, user=params.hive_user)
-
       thriftserver_no_op_test = format(
       'ls {spark_thrift_server_pid_file} >/dev/null 2>&1 && ps -p `cat
{spark_thrift_server_pid_file}` >/dev/null 2>&1')
       try:

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3641d8/ambari-server/src/main/resources/common-services/SPARK/1.4.1/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK/1.4.1/kerberos.json b/ambari-server/src/main/resources/common-services/SPARK/1.4.1/kerberos.json
index 21ba259..e7f78cd 100644
--- a/ambari-server/src/main/resources/common-services/SPARK/1.4.1/kerberos.json
+++ b/ambari-server/src/main/resources/common-services/SPARK/1.4.1/kerberos.json
@@ -33,6 +33,12 @@
           "spark-defaults": {
             "spark.history.kerberos.enabled": "true"
           }
+        },
+        {
+          "spark-thrift-sparkconf": {
+            "spark.yarn.keytab": "${spark-env/hive_kerberos_keytab}",
+            "spark.yarn.principal": "${spark-env/hive_kerberos_principal}"
+          }
         }
       ],
       "components": [

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3641d8/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/configuration/spark2-env.xml
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/configuration/spark2-env.xml
b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/configuration/spark2-env.xml
index 5a3edef..b78fd79 100755
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/configuration/spark2-env.xml
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/configuration/spark2-env.xml
@@ -69,6 +69,18 @@
     </value-attributes>
     <on-ambari-upgrade add="true"/>
   </property>
+  <property>
+    <name>hive_kerberos_keytab</name>
+    <value>{{hive_kerberos_keytab}}</value>
+    <description>hive keytab for spark thirft server</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
+  <property>
+    <name>hive_kerberos_principal</name>
+    <value>{{hive_kerberos_principal}}</value>
+    <description>hive principal for spark thrift server</description>
+    <on-ambari-upgrade add="true"/>
+  </property>
   <!-- spark-env.sh -->
   <property>
     <name>content</name>

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3641d8/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/kerberos.json b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/kerberos.json
index 3aafb75..20e1dc0 100755
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/kerberos.json
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/kerberos.json
@@ -33,6 +33,12 @@
           "spark2-defaults": {
             "spark.history.kerberos.enabled": "true"
           }
+        },
+        {
+          "spark2-thrift-sparkconf": {
+            "spark.yarn.keytab": "${spark2-env/hive_kerberos_keytab}",
+            "spark.yarn.principal": "${spark2-env/hive_kerberos_principal}"
+          }
         }
       ],
       "components": [

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3641d8/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py
b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py
index c89a302..e461186 100755
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/params.py
@@ -18,6 +18,7 @@ limitations under the License.
 
 """
 
+import socket
 
 import status_params
 from resource_management.libraries.functions.stack_features import check_stack_feature
@@ -148,7 +149,7 @@ if security_enabled:
     })
 
     hive_kerberos_keytab = config['configurations']['hive-site']['hive.server2.authentication.kerberos.keytab']
-    hive_kerberos_principal = config['configurations']['hive-site']['hive.server2.authentication.kerberos.principal']
+    hive_kerberos_principal = config['configurations']['hive-site']['hive.server2.authentication.kerberos.principal'].replace('_HOST',
socket.getfqdn().lower())
 
 # thrift server support - available on HDP 2.3 or higher
 spark_thrift_sparkconf = None

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3641d8/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/spark_service.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/spark_service.py
b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/spark_service.py
index 834871d..308dd3d 100755
--- a/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/spark_service.py
+++ b/ambari-server/src/main/resources/common-services/SPARK2/2.0.0/package/scripts/spark_service.py
@@ -96,11 +96,6 @@ def spark_service(name, upgrade_type=None, action=None):
         raise
 
     elif name == 'sparkthriftserver':
-      if params.security_enabled:
-        hive_principal = params.hive_kerberos_principal.replace('_HOST', socket.getfqdn().lower())
-        hive_kinit_cmd = format("{kinit_path_local} -kt {hive_kerberos_keytab} {hive_principal};
")
-        Execute(hive_kinit_cmd, user=params.hive_user)
-
       thriftserver_no_op_test = format(
       'ls {spark_thrift_server_pid_file} >/dev/null 2>&1 && ps -p `cat
{spark_thrift_server_pid_file}` >/dev/null 2>&1')
       try:

http://git-wip-us.apache.org/repos/asf/ambari/blob/3e3641d8/ambari-server/src/main/resources/stacks/HDP/2.5/services/SPARK/kerberos.json
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.5/services/SPARK/kerberos.json
b/ambari-server/src/main/resources/stacks/HDP/2.5/services/SPARK/kerberos.json
index ea2cf52..2d52fb3 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.5/services/SPARK/kerberos.json
+++ b/ambari-server/src/main/resources/stacks/HDP/2.5/services/SPARK/kerberos.json
@@ -65,6 +65,12 @@
           }
         },
         {
+          "spark-thrift-sparkconf": {
+            "spark.yarn.keytab": "${spark-env/hive_kerberos_keytab}",
+            "spark.yarn.principal": "${spark-env/hive_kerberos_principal}"
+          }
+        },
+        {
           "livy-conf": {
             "livy.server.auth.type": "kerberos",
             "livy.impersonation.enabled": "true",


Mime
View raw message