title: Where HDFS stores data
body: <p>I am trying to understand where hadoop stores data in HDFS. I refer to the config files viz: <code>core-site.xml</code> and <code>hdfs-site.xml</code></p>
  
  <p>The property that I have set is:</p>
  
  <ul>
  <li><p>In <code>core-site.xml</code>:</p>
  
  <pre><code>&lt;property&gt;
      &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;
      &lt;value&gt;/hadoop/tmp&lt;/value&gt;
  &lt;/property&gt;
  </code></pre></li>
  <li><p>In <code>hdfs-site.xml</code>:</p>
  
  <pre><code>&lt;property&gt;
      &lt;name&gt;dfs.namenode.name.dir&lt;/name&gt;
      &lt;value&gt;file:/hadoop/hdfs/namenode&lt;/value&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
      &lt;name&gt;dfs.datanode.data.dir&lt;/name&gt;
      &lt;value&gt;file:/hadoop/hdfs/datanode&lt;/value&gt;
  &lt;/property&gt;
  </code></pre></li>
  </ul>
  
  <p>With the above arrangement, like <code>dfs.datanode.data.dir</code>, the data blocks should be stored in this directory. Is this correct?</p>
  
  <p>I referred to the apache hadoop link, and from that i see this:</p>
  
  <ul>
  <li><p><code>core-default.xml</code>:  <code>hadoop.tmp.dir</code> --> A base for other temporary directories.</p></li>
  <li><p><code>hdfs-default.xml</code> <code>dfs.datanode.data.dir</code> --> Determines where on the local filesystem an DFS data node should store its blocks.</p>
  
  <p>The default value for this property being -> <code>file://${hadoop.tmp.dir}/dfs/data</code></p></li>
  </ul>
  
  <p>Since I explicitly provided the value for <code>dfs.datanode.data.dir</code> (<code>hdfs-site.xml</code>), does it mean data would be stored in that location? If so, would dfs/data be added to the directory to <code>${dfs.datanode.data.dir}</code>, specifically would it become -> <code>/hadoop/hdfs/datanode/dfs/data</code>?</p>
  
  <p>However I didn't see this directory structure getting created.</p>
  
  <p>One observation that I saw in my env:</p>
  
  <p>I saw that after I run some <em>MapReduce</em> programs, this directory is created viz:
  <code>/hadoop/tmp/dfs/data</code> is getting created.</p>
  
  <p>So, not sure if data gets stored in the directory as suggested by the property dfs.datanode.data.dir.</p>
  
  <p>Does anyone have similar experience?</p>