ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aonis...@apache.org
Subject git commit: AMBARI-5729. Decommission issues in secure cluster. (aonishuk)
Date Mon, 12 May 2014 10:54:49 GMT
Repository: ambari
Updated Branches:
  refs/heads/trunk e5fb45aec -> e5a25a91b


AMBARI-5729. Decommission issues in 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/e5a25a91
Tree: http://git-wip-us.apache.org/repos/asf/ambari/tree/e5a25a91
Diff: http://git-wip-us.apache.org/repos/asf/ambari/diff/e5a25a91

Branch: refs/heads/trunk
Commit: e5a25a91b698f03d12c5de132fe1c0cceefc6777
Parents: e5fb45a
Author: Andrew Onishuk <aonishuk@hortonworks.com>
Authored: Mon May 12 13:53:49 2014 +0300
Committer: Andrew Onishuk <aonishuk@hortonworks.com>
Committed: Mon May 12 13:53:49 2014 +0300

----------------------------------------------------------------------
 .../2.0.6/services/HDFS/package/scripts/hdfs_namenode.py |  7 ++++++-
 .../HDP/2.0.6/services/HDFS/package/scripts/params.py    | 10 ++++++++++
 .../HDP/2.0.6/services/YARN/package/scripts/params.py    | 11 ++++++-----
 .../services/YARN/package/scripts/resourcemanager.py     |  4 ++--
 4 files changed, 24 insertions(+), 8 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/ambari/blob/e5a25a91/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs_namenode.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs_namenode.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs_namenode.py
index e7ed33b..0086b13 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs_namenode.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/hdfs_namenode.py
@@ -133,12 +133,17 @@ def decommission():
   hdfs_user = params.hdfs_user
   conf_dir = params.hadoop_conf_dir
   user_group = params.user_group
-
+  dn_kinit_cmd = params.dn_kinit_cmd
+  
   File(params.exclude_file_path,
        content=Template("exclude_hosts_list.j2"),
        owner=hdfs_user,
        group=user_group
   )
+  
+  Execute(dn_kinit_cmd,
+          user=hdfs_user
+  )
 
   ExecuteHadoop('dfsadmin -refreshNodes',
                 user=hdfs_user,

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5a25a91/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/params.py
----------------------------------------------------------------------
diff --git a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/params.py
b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/params.py
index 7bc8ca7..a6fea72 100644
--- a/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/params.py
+++ b/ambari-server/src/main/resources/stacks/HDP/2.0.6/services/HDFS/package/scripts/params.py
@@ -149,6 +149,16 @@ if dfs_ha_enabled:
 journalnode_address = default('/configurations/hdfs-site/dfs.journalnode.http-address', None)
 if journalnode_address:
   journalnode_port = journalnode_address.split(":")[1]
+  
+  
+if security_enabled:
+  _dn_principal_name = config['configurations']['hdfs-site']['dfs.datanode.kerberos.principal']
+  _dn_keytab = config['configurations']['hdfs-site']['dfs.datanode.keytab.file']
+  _dn_principal_name = _dn_principal_name.replace('_HOST',hostname.lower())
+  
+  dn_kinit_cmd = format("{kinit_path_local} -kt {_dn_keytab} {_dn_principal_name};")
+else:
+  dn_kinit_cmd = ""
 
 import functools
 #create partial functions with common arguments for every HdfsDirectory call

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5a25a91/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 065467c..e85a2ee 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
@@ -94,12 +94,13 @@ exclude_file_path = default("/configurations/yarn-site/yarn.resourcemanager.node
 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};")
+  _rm_principal_name = config['configurations']['yarn-site']['yarn.resourcemanager.principal']
+  _rm_keytab = config['configurations']['yarn-site']['yarn.resourcemanager.keytab']
+  _rm_principal_name = _rm_principal_name.replace('_HOST',hostname.lower())
+  
+  rm_kinit_cmd = format("{kinit_path_local} -kt {_rm_keytab} {_rm_principal_name};")
 else:
-  nm_kinit_cmd = ""
+  rm_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']

http://git-wip-us.apache.org/repos/asf/ambari/blob/e5a25a91/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 6e6b34f..605d9bf 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
@@ -67,12 +67,12 @@ class Resourcemanager(Script):
     import params
 
     env.set_params(params)
-    nm_kinit_cmd = params.nm_kinit_cmd
+    rm_kinit_cmd = params.rm_kinit_cmd
     yarn_user = params.yarn_user
     conf_dir = params.config_dir
     user_group = params.user_group
 
-    yarn_refresh_cmd = format("{nm_kinit_cmd} /usr/bin/yarn --config {conf_dir} rmadmin -refreshNodes")
+    yarn_refresh_cmd = format("{rm_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