You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@ambari.apache.org by hi...@apache.org on 2012/08/16 23:57:02 UTC
svn commit: r1374078 - in /incubator/ambari/branches/branch-0.9: CHANGES.txt
hmc/puppet/modules/hdp-hadoop/files/checkForFormat.sh
hmc/puppet/modules/hdp-hadoop/manifests/namenode/format.pp
hmc/puppet/modules/hdp-hadoop/manifests/params.pp
Author: hitesh
Date: Thu Aug 16 21:57:02 2012
New Revision: 1374078
URL: http://svn.apache.org/viewvc?rev=1374078&view=rev
Log:
AMBARI-667. After reboots, namenode start fails as it thinks dfs is not formatted. (Contributed by hitesh)
Modified:
incubator/ambari/branches/branch-0.9/CHANGES.txt
incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/files/checkForFormat.sh
incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/namenode/format.pp
incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/params.pp
Modified: incubator/ambari/branches/branch-0.9/CHANGES.txt
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-0.9/CHANGES.txt?rev=1374078&r1=1374077&r2=1374078&view=diff
==============================================================================
--- incubator/ambari/branches/branch-0.9/CHANGES.txt (original)
+++ incubator/ambari/branches/branch-0.9/CHANGES.txt Thu Aug 16 21:57:02 2012
@@ -6,6 +6,8 @@ characters wide.
Release 0.9.0 - unreleased
+ AMBARI-667. After reboots, namenode start fails as it thinks dfs is not formatted (hitesh)
+
AMBARI-668. Ambari should install yum priorities plugin on all nodes to ensure repo
priorities are adhered to. (hitesh)
Modified: incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/files/checkForFormat.sh
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/files/checkForFormat.sh?rev=1374078&r1=1374077&r2=1374078&view=diff
==============================================================================
--- incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/files/checkForFormat.sh (original)
+++ incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/files/checkForFormat.sh Thu Aug 16 21:57:02 2012
@@ -24,7 +24,7 @@ export hdfs_user=$1
shift
export conf_dir=$1
shift
-export mark_file=$1
+export mark_dir=$1
shift
export name_dirs=$*
@@ -32,9 +32,15 @@ export EXIT_CODE=0
export command="namenode -format"
export list_of_non_empty_dirs=""
-if [[ ! -f $mark_file ]] ; then
+mark_file=/var/run/hadoop/hdfs/namenode-formatted
+if [[ -f ${mark_file} ]] ; then
+ rm -f ${mark_file}
+ mkdir -p ${mark_dir}
+fi
+
+if [[ ! -d $mark_dir ]] ; then
for dir in `echo $name_dirs | tr ',' ' '` ; do
- echo "DIrname = $dir"
+ echo "NameNode Dirname = $dir"
cmd="ls $dir | wc -l | grep -q ^0$"
eval $cmd
if [[ $? -ne 0 ]] ; then
@@ -43,11 +49,13 @@ if [[ ! -f $mark_file ]] ; then
fi
done
- if [[ $EXIT_CODE == 0 ]] ; then
+ if [[ $EXIT_CODE == 0 ]] ; then
su - ${hdfs_user} -c "yes Y | hadoop --config ${conf_dir} ${command}"
else
echo "ERROR: Namenode directory(s) is non empty. Will not format the namenode. List of non-empty namenode dirs ${list_of_non_empty_dirs}"
fi
+else
+ echo "${mark_dir} exists. Namenode DFS already formatted"
fi
exit $EXIT_CODE
Modified: incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/namenode/format.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/namenode/format.pp?rev=1374078&r1=1374077&r2=1374078&view=diff
==============================================================================
--- incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/namenode/format.pp (original)
+++ incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/namenode/format.pp Thu Aug 16 21:57:02 2012
@@ -22,7 +22,7 @@ class hdp-hadoop::namenode::format(
$force = false
)
{
- $mark_file = $hdp-hadoop::params::namenode_formatted_mark_file
+ $mark_dir = $hdp-hadoop::params::namenode_formatted_mark_dir
$dfs_name_dir = $hdp-hadoop::params::dfs_name_dir
$hdfs_user = $hdp::params::hdfs_user
$hadoop_conf_dir = $hdp-hadoop::params::conf_dir
@@ -40,8 +40,8 @@ class hdp-hadoop::namenode::format(
}
exec { '/tmp/checkForFormat.sh':
- command => "sh /tmp/checkForFormat.sh ${hdfs_user} ${hadoop_conf_dir} ${mark_file} ${dfs_name_dir} ",
- unless => "test -f ${mark_file}",
+ 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",
@@ -50,7 +50,7 @@ class hdp-hadoop::namenode::format(
}
hdp::exec { 'set namenode mark' :
- command => "touch ${mark_file}",
+ command => "mkdir -p ${mark_dir}",
refreshonly => true
}
}
Modified: incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/params.pp
URL: http://svn.apache.org/viewvc/incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/params.pp?rev=1374078&r1=1374077&r2=1374078&view=diff
==============================================================================
--- incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/params.pp (original)
+++ incubator/ambari/branches/branch-0.9/hmc/puppet/modules/hdp-hadoop/manifests/params.pp Thu Aug 16 21:57:02 2012
@@ -41,9 +41,9 @@ class hdp-hadoop::params(
$hadoop_logdirprefix = hdp_default("hadoop/hadoop-env/hadoop_logdirprefix","/var/log/hadoop")
$hadoop_piddirprefix = hdp_default("hadoop/hadoop-env/hadoop_piddirprefix","/var/run/hadoop")
- $run_dir = $hadoop_piddirprefix
- $namenode_formatted_mark_file = "${run_dir}/hdfs/namenode-formatted"
+ $run_dir = $hadoop_piddirprefix
+ $namenode_formatted_mark_dir = "${run_dir}/hdfs/namenode/formatted/"
$jtnode_heapsize = hdp_default("hadoop/hadoop-env/jtnode_heapsize","1024m")