ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject [1/2] git commit: AMBARI-7882. Decommission of JobTracker fails on secure cluster (aonishuk)
Date Tue, 21 Oct 2014 15:15:30 GMT
Repository: ambari
Updated Branches:
  refs/heads/branch-1.7.0 3fa34491c -> fe60f057e
  refs/heads/trunk 64a73207e -> 99de55ab8


AMBARI-7882. Decommission of JobTracker fails on secure cluster (aonishuk)


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

Branch: refs/heads/trunk
Commit: 99de55ab85662d0050b7030a8f17175723e0cf97
Parents: 64a7320
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Tue Oct 21 18:15:16 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Tue Oct 21 18:15:16 2014 +0300

----------------------------------------------------------------------
 .../1.3.2/services/MAPREDUCE/package/scripts/jobtracker.py    | 4 ++++
 .../HDP/1.3.2/services/MAPREDUCE/package/scripts/params.py    | 7 +++++++
 .../src/test/python/stacks/1.3.2/HDFS/test_hdfs_client.py     | 1 -
 .../stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py       | 3 +++
 4 files changed, 14 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/99de55ab/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/jobtracker.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/jobtracker.py
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/jobtracker.py
index 783261e..2ca04fe 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/jobtracker.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/jobtracker.py
@@ -65,6 +65,10 @@ class Jobtracker(Script):
     conf_dir = params.conf_dir
     user_group = params.user_group
 
+    if params.security_enabled:
+      Execute(params.kinit_cmd,
+         user = params.mapred_user)
+
     File(params.exclude_file_path,
          content=Template("exclude_hosts_list.j2"),
          owner=mapred_user,

http://git-wip-us.apache.org/repos/asf/ambari/blob/99de55ab/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/params.py
b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/params.py
index 13642d2..1900598 100644
--- a/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/1.3.2/services/MAPREDUCE/package/scripts/params.py
@@ -60,6 +60,13 @@ mapreduce_jobhistory_done_dir = config['configurations']['mapred-site']['mapred.
 hostname = config["hostname"]
 hadoop_conf_dir = "/etc/hadoop/conf"
 hadoop_pid_dir_prefix = config['configurations']['hadoop-env']['hadoop_pid_dir_prefix']
+
+if security_enabled:
+  jt_principal_name = config['configurations']['mapred-site']['mapreduce.jobtracker.kerberos.principal']
+  jt_principal_name = jt_principal_name.replace('_HOST',hostname.lower())
+  jt_user_keytab = config['configurations']['mapred-site']['mapreduce.jobtracker.keytab.file']
+  kinit_cmd = format("{kinit_path_local} -kt {jt_user_keytab} {jt_principal_name}")
+
 hdfs_user_keytab = config['configurations']['hadoop-env']['hdfs_user_keytab']
 hdfs_user = config['configurations']['hadoop-env']['hdfs_user']
 hdfs_principal_name = config['configurations']['hadoop-env']['hdfs_principal_name']

http://git-wip-us.apache.org/repos/asf/ambari/blob/99de55ab/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_hdfs_client.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_hdfs_client.py b/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_hdfs_client.py
index d234c5f..80da9b6 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_hdfs_client.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/HDFS/test_hdfs_client.py
@@ -39,7 +39,6 @@ class Test(RMFTestCase):
     self.assertResourceCalled('Directory', '/tmp',
                               recursive = True,
                               )
-    self.printResources()
     self.assertResourceCalled('XmlConfig', 'core-site.xml',
                               conf_dir = '/tmp/123',
                               configuration_attributes = self.getConfig()['configuration_attributes']['core-site'],

http://git-wip-us.apache.org/repos/asf/ambari/blob/99de55ab/ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py
b/ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py
index 1c3882f..2430d93 100644
--- a/ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py
+++ b/ambari-server/src/test/python/stacks/1.3.2/MAPREDUCE/test_mapreduce_jobtracker.py
@@ -149,6 +149,9 @@ class TestJobtracker(RMFTestCase):
                        config_file="secured.json"
     )
 
+    self.assertResourceCalled('Execute', '/usr/bin/kinit -kt /etc/security/keytabs/jt.service.keytab
jt/c6402.ambari.apache.org@EXAMPLE.COM',
+                       user = 'mapred',
+    )
     self.assertResourceCalled('File', '/etc/hadoop/conf/mapred.exclude',
                        owner = 'mapred',
                        content = Template('exclude_hosts_list.j2'),


Mime
View raw message