incubator-ambari-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dmitriu...@apache.org
Subject git commit: AMBARI-3108. If the directories for NN/DN are changed the puppet scripts do not create the new dirs. (Vitaly Brodetskyi via dlysnichenko)
Date Thu, 05 Sep 2013 12:05:31 GMT
Updated Branches:
  refs/heads/trunk ee4997c52 -> c25e5c224


AMBARI-3108. If the directories for NN/DN are changed the puppet scripts do not create the
new dirs. (Vitaly Brodetskyi via dlysnichenko)


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

Branch: refs/heads/trunk
Commit: c25e5c224ed12a02e3583fc67e762263f4ac1047
Parents: ee4997c
Author: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Authored: Thu Sep 5 15:04:16 2013 +0300
Committer: Lisnichenko Dmitro <dlysnichenko@hortonworks.com>
Committed: Thu Sep 5 15:04:16 2013 +0300

----------------------------------------------------------------------
 .../modules/hdp-hadoop/files/checkForFormat.sh       | 15 +++++++++++++++
 .../modules/hdp-hadoop/manifests/namenode/format.pp  |  1 -
 2 files changed, 15 insertions(+), 1 deletion(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/c25e5c22/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkForFormat.sh
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkForFormat.sh b/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkForFormat.sh
index d14091a..a16b64e 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkForFormat.sh
+++ b/ambari-agent/src/main/puppet/modules/hdp-hadoop/files/checkForFormat.sh
@@ -38,6 +38,21 @@ if [[ -f ${mark_file} ]] ; then
   mkdir -p ${mark_dir}
 fi
 
+#---Additional check, to format namenode directories if their pathes were changed.
+for dir in `echo $name_dirs | tr ',' ' '` ; do
+  cmd="ls $dir | wc -l  | grep -q ^0$"
+  eval $cmd
+  if [[ $? -eq 0 ]] ; then
+    list_of_empty_dirs="$list_of_empty_dirs $dir"
+  fi
+done
+
+if [[ -d $mark_dir ]] && [[ ! -z $list_of_empty_dirs ]]; then
+  echo "Removing mark directory: ${mark_dir}"
+  rm -rf ${mark_dir}
+fi
+#---
+
 if [[ ! -d $mark_dir ]] ; then
   for dir in `echo $name_dirs | tr ',' ' '` ; do
     echo "NameNode Dirname = $dir"

http://git-wip-us.apache.org/repos/asf/incubator-ambari/blob/c25e5c22/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/namenode/format.pp
----------------------------------------------------------------------
diff --git a/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/namenode/format.pp
b/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/namenode/format.pp
index fb9d2ab..7dcca2d 100644
--- a/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/namenode/format.pp
+++ b/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/namenode/format.pp
@@ -45,7 +45,6 @@ class hdp-hadoop::namenode::format(
 
       exec { '/tmp/checkForFormat.sh':
         command   => "sh /tmp/checkForFormat.sh ${hdfs_user} ${hadoop_conf_dir} ${mark_dir}
${dfs_name_dir} ",
-        unless   => "test -d ${mark_dir}",
         require   => File['/tmp/checkForFormat.sh'],
         path      => '/usr/sbin:/sbin:/usr/local/bin:/bin:/usr/bin',
         logoutput => "true",


Mime
View raw message