title: What the command "hadoop namenode -format" will do
body: <p>I am trying to learn Hadoop by following a tutorial and trying to do pseudo-distributed mode on my machine.</p>
  
  <p>My <code>core-site.xml</code> is:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="configuration.xsl"?&gt;
  
  &lt;configuration&gt;
     &lt;property&gt;
        &lt;name&gt;fs.default.name&lt;/name&gt;
        &lt;value&gt;hdfs://localhost:9000&lt;/value&gt;
        &lt;description&gt;The name of the default file system. A URI whose scheme and authority determine the FileSystem implementation.       
        &lt;/description&gt;   
     &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>My <code>hdfs-site.xml</code> file is:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="configuration.xsl"?&gt;
  
  &lt;configuration&gt;
     &lt;property&gt;
        &lt;name&gt;dfs.replication&lt;/name&gt;
        &lt;value&gt;1&lt;/value&gt;
        &lt;description&gt;The actual number of replications can be specified when the
          file is created.
        &lt;/description&gt;
     &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>My <code>mapred-site.xml</code> file is:</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="configuration.xsl"?&gt;
  
  &lt;configuration&gt;
     &lt;property&gt;      
        &lt;name&gt;mapred.job.tracker&lt;/name&gt;
        &lt;value&gt;localhost:9001&lt;/value&gt;
        &lt;description&gt;The host and port that the MapReduce job tracker runs
          at.
        &lt;/description&gt;
     &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>When I run the command it ran successfully but what it is doing actually:</p>
  
  <pre><code>hadoop-1.2.1$ bin/hadoop namenode -format
  14/11/26 12:37:16 INFO namenode.NameNode: STARTUP_MSG: 
  /************************************************************
  STARTUP_MSG: Starting NameNode
  STARTUP_MSG:   host = myhost/127.0.0.8
  STARTUP_MSG:   args = [-format]
  STARTUP_MSG:   version = 1.2.1
  STARTUP_MSG:   build = https://svn.apache.org/repos/asf/hadoop/common/branches/branch-1.2 -r 1503152; compiled by 'mattf' on Mon Jul 22 15:23:09 PDT 2013
  STARTUP_MSG:   java = 1.6.0_45
  ************************************************************/
  14/11/26 12:37:17 INFO util.GSet: Computing capacity for map BlocksMap
  14/11/26 12:37:17 INFO util.GSet: VM type       = 64-bit
  14/11/26 12:37:17 INFO util.GSet: 2.0% max memory = 932118528
  14/11/26 12:37:17 INFO util.GSet: capacity      = 2^21 = 2097152 entries
  14/11/26 12:37:17 INFO util.GSet: recommended=2097152, actual=2097152
  14/11/26 12:37:17 INFO namenode.FSNamesystem: fsOwner=myuser
  14/11/26 12:37:17 INFO namenode.FSNamesystem: supergroup=supergroup
  14/11/26 12:37:17 INFO namenode.FSNamesystem: isPermissionEnabled=true
  14/11/26 12:37:17 INFO namenode.FSNamesystem: dfs.block.invalidate.limit=100
  14/11/26 12:37:17 INFO namenode.FSNamesystem: isAccessTokenEnabled=false accessKeyUpdateInterval=0 min(s), accessTokenLifetime=0 min(s)
  14/11/26 12:37:17 INFO namenode.FSEditLog: dfs.namenode.edits.toleration.length = 0
  14/11/26 12:37:17 INFO namenode.NameNode: Caching file names occuring more than 10 times 
  14/11/26 12:37:17 INFO common.Storage: Image file /tmp/hadoop-myuser/dfs/name/current/fsimage of size 115 bytes saved in 0 seconds.
  14/11/26 12:37:18 INFO namenode.FSEditLog: closing edit log: position=4, editlog=/tmp/hadoop-myuser/dfs/name/current/edits
  14/11/26 12:37:18 INFO namenode.FSEditLog: close success: truncate to 4, editlog=/tmp/hadoop-myuser/dfs/name/current/edits
  14/11/26 12:37:18 INFO common.Storage: Storage directory /tmp/hadoop-myuser/dfs/name has been successfully formatted.
  14/11/26 12:37:18 INFO namenode.NameNode: SHUTDOWN_MSG: 
  /************************************************************
  SHUTDOWN_MSG: Shutting down NameNode at chaitanya-OptiPlex-3010/127.0.0.8
  ************************************************************/
  </code></pre>
  
  <p>Can someone please let me know what it is doing internally.</p>
  
  <p>I have gone through these posts but there is no correct explanation.</p>
  
  <p><a href="https://stackoverflow.com/questions/18862875/what-exactly-is-hadoop-namenode-formatting">What exactly is hadoop namenode formatting?</a></p>
  
  <p><a href="https://stackoverflow.com/questions/21857724/hadoop-namenode-is-not-formatting">hadoop namenode is not formatting</a></p>
  
  <p>How can I check this practically on my machine so I can see the differences before and after running the command. I am new to Hadoop so this can be a trivial question.</p>