title: Hadoop: each namenode and datanode only last for a momentary time
body: <p>Using CentOs 5.4</p>
  
  <p>Three virtual machines(using vmware workstation):<strong>master</strong>, <strong>slave1</strong>, <strong>slave2</strong>. <strong>master</strong> is used for the namenode, and <strong>slave1 slave2</strong> are used for the datanodes. </p>
  
  <p>Hadoop version is <strong>hadoop-0.20.1.tar.gz</strong>, I have configured all the relative files, and closed the firewall with root user using the command:<code>/sbin/service iptables stop</code>. Then I tried to format namenode and start hadoop in the <strong>master</strong>(namenode) virtual machine with the following commands, no error was reported.</p>
  
  <pre><code>bin/hadoop namenode -format
  bin/start-all.sh
  </code></pre>
  
  <p>Then I typed the command "jps" in the <strong>master</strong> machine right now, and found the right result:</p>
  
  <pre><code>5144 JobTracker
  4953 NameNode
  5079 SecondaryNameNode
  5216 Jps
  </code></pre>
  
  <p>But after about several seconds, when I tried to type the "jps" command, all the virtual machines only have one process: JPS. The following is the result displayed in the namenode(<strong>master</strong>)</p>
  
  <pre><code>5236 Jps
  </code></pre>
  
  <p>What's the matter? Or how can I find what caused the matter? Dose it mean that it cannot find any namenode or datanode? Thank you.</p>
  
  <hr>
  
  <p><em><strong>Attachment</em></strong>: all the places I have modified:</p>
  
  <p>hadoop-env.sh:</p>
  
  <pre><code># set java environment
  export JAVA_HOME=/usr/jdk1.6.0_13/
  </code></pre>
  
  <p>core-site.xml:</p>
  
  <pre><code>&lt;configuration&gt;
  
  &lt;property&gt;
          &lt;name&gt;master.node&lt;/name&gt;
          &lt;value&gt;namenode_master&lt;/value&gt;
          &lt;description&gt;master&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
          &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;
          &lt;value&gt;/usr/local/hadoop/tmp&lt;/value&gt;
          &lt;description&gt;local dir&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
          &lt;name&gt;fs.default.name&lt;/name&gt;
          &lt;value&gt;hdfs://${master.node}:9000&lt;/value&gt;
          &lt;description&gt; &lt;/description&gt;
  &lt;/property&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>hdfs-site.xml:</p>
  
  <pre><code>&lt;configuration&gt;
     &lt;property&gt;
         &lt;name&gt;dfs.replication&lt;/name&gt;  
         &lt;value&gt;2&lt;/value&gt;   
    &lt;/property&gt;
  
  &lt;property&gt;
       &lt;name&gt;dfs.name.dir&lt;/name&gt;
           &lt;value&gt;${hadoop.tmp.dir}/hdfs/name&lt;/value&gt;
           &lt;description&gt;local dir&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
       &lt;name&gt;dfs.data.dir&lt;/name&gt;
       &lt;value&gt;${hadoop.tmp.dir}/hdfs/data&lt;/value&gt;
       &lt;description&gt;  &lt;/description&gt;
  &lt;/property&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>mapred-site.xml:</p>
  
  <pre><code>&lt;configuration&gt;
  
  &lt;property&gt;
          &lt;name&gt;mapred.job.tracker&lt;/name&gt;
          &lt;value&gt;${master.node}:9001&lt;/value&gt;
          &lt;description&gt; &lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
          &lt;name&gt;mapred.local.dir&lt;/name&gt;
          &lt;value&gt;${hadoop.tmp.dir}/mapred/local&lt;/value&gt;
          &lt;description&gt; &lt;/description&gt;
  &lt;/property&gt;
  
  &lt;property&gt;
          &lt;name&gt;mapred.system.dir&lt;/name&gt;
          &lt;value&gt;/tmp/mapred/system&lt;/value&gt;
          &lt;description&gt;hdfs dir&lt;/description&gt;
  &lt;/property&gt;
  
  &lt;/configuration&gt;
  </code></pre>
  
  <p>master:</p>
  
  <pre><code>master
  </code></pre>
  
  <p>slaves:</p>
  
  <pre><code>slave1 
  slave2  
  </code></pre>
  
  <p>/etc/hosts:</p>
  
  <pre><code>192.168.190.133 master
  192.168.190.134 slave1
  192.168.190.135 slave2
  </code></pre>