ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject git commit: AMBARI-4961. Decommission of NodeManager failed after enabling security (Arsen Babych via dlysnichenko)
Date Wed, 05 Mar 2014 19:22:49 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk 41b194064 -> 221c8215a


AMBARI-4961. Decommission of NodeManager failed after enabling security (Arsen Babych via
dlysnichenko)


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

Branch: refs/heads/trunk
Commit: 221c8215adc2be3735ac22bbf195bb5262358757
Parents: 41b1940
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Wed Mar 5 21:20:23 2014 +0200
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Wed Mar 5 21:22:37 2014 +0200

----------------------------------------------------------------------
 .../HDP/2.0.6/services/YARN/package/scripts/params.py    | 11 ++++++++++-
 .../services/YARN/package/scripts/resourcemanager.py     |  4 ++--
 2 files changed, 12 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/221c8215/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/params.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/params.py
index 37d467f..9d69013 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/params.py
@@ -90,6 +90,15 @@ yarn_container_bin = "/usr/lib/hadoop-yarn/bin"
 exclude_hosts = default("/clusterHostInfo/decom_nm_hosts", [])
 exclude_file_path = config['configurations']['yarn-site']['yarn.resourcemanager.nodes.exclude-path']
 
+hostname = config['hostname']
+
+if security_enabled:
+  nm_principal_name = config['configurations']['global']['nodemanager_principal_name']
+  nodemanager_keytab = config['configurations']['global']['nodemanager_keytab']
+  nodemanager_principal_name = nm_principal_name.replace('_HOST',hostname.lower())
+  nm_kinit_cmd = format("{kinit_path_local} -kt {nodemanager_keytab} {nodemanager_principal_name};")
+else:
+  nm_kinit_cmd = ""
 
 yarn_log_aggregation_enabled = config['configurations']['yarn-site']['yarn.log-aggregation-enable']
 yarn_nm_app_log_dir =  config['configurations']['yarn-site']['yarn.nodemanager.remote-app-log-dir']
@@ -113,4 +122,4 @@ HdfsDirectory = functools.partial(
   keytab = hdfs_user_keytab,
   kinit_path_local = kinit_path_local
 )
-update_exclude_file_only = config['commandParams']['update_exclude_file_only']
\ No newline at end of file
+update_exclude_file_only = config['commandParams']['update_exclude_file_only']

http://git-wip-us.apache.org/repos/asf/ambari/blob/221c8215/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/resourcemanager.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/resourcemanager.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/resourcemanager.py
index fa9ca81..4af82c7 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/resourcemanager.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/YARN/package/scripts/resourcemanager.py
@@ -89,12 +89,12 @@ class Resourcemanager(Script):
     import params
 
     env.set_params(params)
-
+    nm_kinit_cmd = params.nm_kinit_cmd
     yarn_user = params.yarn_user
     conf_dir = params.config_dir
     user_group = params.user_group
 
-    yarn_refresh_cmd = format("/usr/bin/yarn --config {conf_dir} rmadmin -refreshNodes")
+    yarn_refresh_cmd = format("{nm_kinit_cmd} /usr/bin/yarn --config {conf_dir} rmadmin -refreshNodes")
 
     File(params.exclude_file_path,
          content=Template("exclude_hosts_list.j2"),


Mime
View raw message