Correct way to format a namenode :

<hdfs_home>/bin/hdfs namenode -format -clusterid <cid>

PS: Set your environment right like common home etc.


Only first time it requires the cluster id, second time onwards it will 
remember cluster id and prompt you to format this particular cluster id.


I have filed a Jira on this:

https://issues.apache.org/jira/browse/HDFS-1905


-Bharath


________________________________
From: Doug Balog <doug.hdphdfs...@dugos.com>
To: hdfs-dev@hadoop.apache.org
Sent: Wednesday, May 11, 2011 8:03 PM
Subject: Question about hadoop namenode -format -clusterid <clusterID> 

I'm at the hackathon in SF just trying to setup a single node cluster from my 
trunk checkout.
I'm at the point where I need to format a new namenode, and the old way of 
just running "hadoop namenode -format" is failing because I'm not specifying a 
clusterID.

So I started poking around the code to try and figure what is expected for the 
clusterID
and I found that the namenode had a hidden option "-genclusterid" which
causes the namenode to just print out a new clusterID and exit. 
I say hidden because if you run "hadoop namenode -usage" its not one of the 
listed
options.

What is the correct way to format a namenode now (in trunk) ? 
The current documentation doesn't match what the code does, 
so its unclear to me how this is supposed to work.

IMHO   "bin/namenode -format" should automaticlly generate a clusterID for you 
and
it should exit with an Exception. This is what everybody has been trained to do.
The only time you should have to specify a  clusterID is when you want to 
add a namenode to an existing cluster.


Doug

Reply via email to