Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What exactly is hadoop namenode formatting?

What exactly is involved in namenode formatting. If I type in the following command into my terminal within my hadoop installation folder:

  bin/hadoop namenode -format 

What exactly does it accomplish? I am looking to understand principles of namenode formatting & its significance. Thanks...

like image 787
Ace Avatar asked Sep 18 '13 02:09

Ace


People also ask

What is NameNode formatting?

Formatting the namenode deletes the information from namenode directory. The NameNode directory is specified in hdfs-site. xml file in dfs. namenode.

What does Hadoop NameNode format do?

Answer (1) Hadoop Namenode is used to specify the default file system and also the defaults of your local file system.So, you need to set it to a HDFS address. This is essential for configuration of client and your Local File system. filesystem.

Why do we need to format NameNode?

When we format namenode it formats the meta-data related to data-nodes. By doing that, all the information on the datanodes are lost and they can be reused for new data.


2 Answers

Hadoop NameNode is the centralized place of an HDFS file system which keeps the directory tree of all files in the file system, and tracks where across the cluster the file data is kept. In short, it keeps the metadata related to datanodes. When we format namenode it formats the meta-data related to data-nodes. By doing that, all the information on the datanodes are lost and they can be reused for new data.

like image 160
techvineet Avatar answered Oct 14 '22 05:10

techvineet


hadoop namenode -format formats your file system at the location specified in hdfs-site.xml

here my namenode directory is /usr/local/hadoop/dfs/name

<property> <name>dfs.name.dir</name> <value>/usr/local/hadoop/dfs/name</value> <final>true</final> </property> 
like image 43
Alkesh_IT Avatar answered Oct 14 '22 04:10

Alkesh_IT