Author: mahadev
Date: Fri Jun 7 18:16:44 2013
New Revision: 1490765
URL: http://svn.apache.org/r1490765
Log:
AMBARI-2301. Ambari starting HDFS from the second try. (Oleksandr Diachenko via
mahadev)
Modified:
incubator/ambari/branches/branch-1.2.4/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/directory.pp
Modified:
incubator/ambari/branches/branch-1.2.4/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/directory.pp
URL:
http://svn.apache.org/viewvc/incubator/ambari/branches/branch-1.2.4/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/directory.pp?rev=1490765&r1=1490764&r2=1490765&view=diff
==============================================================================
---
incubator/ambari/branches/branch-1.2.4/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/directory.pp
(original)
+++
incubator/ambari/branches/branch-1.2.4/ambari-agent/src/main/puppet/modules/hdp-hadoop/manifests/hdfs/directory.pp
Fri Jun 7 18:16:44 2013
@@ -29,6 +29,7 @@ define hdp-hadoop::hdfs::directory(
)
{
$dir_exists = "hadoop fs -ls ${name} >/dev/null 2>&1"
+ $namenode_safe_mode_off = "hadoop dfsadmin -safemode get|grep 'Safe mode is
OFF'"
$tries = 30
$try_sleep = 10
@@ -43,6 +44,7 @@ define hdp-hadoop::hdfs::directory(
hdp-hadoop::exec-hadoop { $mkdir_cmd:
command => $mkdir_cmd,
unless => $dir_exists,
+ onlyif => $namenode_safe_mode_off,
try_sleep => $try_sleep,
tries => $tries
}
@@ -65,7 +67,7 @@ define hdp-hadoop::hdfs::directory(
}
hdp-hadoop::exec-hadoop {$chown_cmd :
command => $chown_cmd,
- onlyif => $dir_exists,
+ onlyif => "$namenode_safe_mode_off && $dir_exists",
try_sleep => $try_sleep,
tries => $tries
}
@@ -81,7 +83,7 @@ define hdp-hadoop::hdfs::directory(
}
hdp-hadoop::exec-hadoop {$chmod_cmd :
command => $chmod_cmd,
- onlyif => $dir_exists,
+ onlyif => "$namenode_safe_mode_off && $dir_exists",
try_sleep => $try_sleep,
tries => $tries
}