title: Cannot initialize Cluster Hadoop-2.7.1 and YARN
body: <p>For simple program wordcount from examples submit job is failing even though all jobs are running. </p>
  
  <pre><code> hadoop jar hadoop-mapreduce-examples-2.7.1.jar wordcount hdfs://localhost:9000/input hdfs://localhost:9000/output
  </code></pre>
  
  <p>JPS</p>
  
  <pre><code>31265 SecondaryNameNode
  31064 DataNode
  30929 NameNode
  31478 ResourceManager
  32354 Jps
  </code></pre>
  
  <p>error</p>
  
  <pre><code>java.io.IOException: Cannot initialize Cluster. Please check your configuration for mapreduce.framework.name and the correspond server addresses.
      at org.apache.hadoop.mapreduce.Cluster.initialize(Cluster.java:120)
      at org.apache.hadoop.mapreduce.Cluster.&lt;init&gt;(Cluster.java:82)
      at org.apache.hadoop.mapreduce.Cluster.&lt;init&gt;(Cluster.java:75)
      at org.apache.hadoop.mapreduce.Job$9.run(Job.java:1260)
      at org.apache.hadoop.mapreduce.Job$9.run(Job.java:1256)
      at java.security.AccessController.doPrivileged(Native Method)
      at javax.security.auth.Subject.doAs(Subject.java:415)
      at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1657)
      at org.apache.hadoop.mapreduce.Job.connect(Job.java:1255)
      at org.apache.hadoop.mapreduce.Job.submit(Job.java:1284)
      at org.apache.hadoop.mapreduce.Job.waitForCompletion(Job.java:1308)
      at org.apache.hadoop.examples.WordCount.main(WordCount.java:87)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.hadoop.util.ProgramDriver$ProgramDescription.invoke(ProgramDriver.java:71)
      at org.apache.hadoop.util.ProgramDriver.run(ProgramDriver.java:144)
      at org.apache.hadoop.examples.ExampleDriver.main(ExampleDriver.java:74)
      at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
      at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
      at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
      at java.lang.reflect.Method.invoke(Method.java:606)
      at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
      at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
  </code></pre>
  
  <p><strong>core-site.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;?xml-stylesheet type="text/xsl" href="configuration.xsl"?&gt;
  &lt;configuration&gt;
  &lt;property&gt;
    &lt;name&gt;hadoop.tmp.dir&lt;/name&gt;
    &lt;value&gt;/usr/local/hadoop_store/hdfs/tmp&lt;/value&gt;
    &lt;description&gt;A base for other temporary directories.&lt;/description&gt;
  &lt;/property&gt;
  &lt;property&gt;
      &lt;name&gt;fs.default.name&lt;/name&gt;
      &lt;value&gt;hdfs://localhost:9000&lt;/value&gt;
  &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>yarn-site.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
   &lt;configuration&gt;
  &lt;property&gt;
     &lt;name&gt;yarn.nodemanager.aux-services&lt;/name&gt;
     &lt;value&gt;mapreduce.shuffle&lt;/value&gt;
  &lt;/property&gt;
  &lt;property&gt;
     &lt;name&gt;yarn.nodemanager.aux-services.mapreduce.shuffle.class&lt;/name&gt;
     &lt;value&gt;org.apache.hadoop.mapred.ShuffleHandler&lt;/value&gt;
  &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>hdfs-site.xml</strong></p>
  
  <pre><code>&lt;?xml version="1.0" encoding="UTF-8"?&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;Default block replication.
    The actual number of replications can be specified when the file is created.
    The default is used if replication is not specified in create time.
    &lt;/description&gt;
   &lt;/property&gt;
   &lt;property&gt;
     &lt;name&gt;dfs.namenode.name.dir&lt;/name&gt;
     &lt;value&gt;file:/usr/local/hadoop_store/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:/usr/local/hadoop_store/hdfs/datanode&lt;/value&gt;
   &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p><strong>mapred-site.xml</strong></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; mapreduce.framework.name &lt;/name&gt;
      &lt;value&gt; yarn &lt;/value&gt;
     &lt;/property&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>I tried many solutions from others SO post like changing <strong>mapreduce.shuffle &lt;-> mapreduce_shuffle</strong> but none of them seems working. All directories exist and webpage is also available on localhost.</p>
  
  <p>System configuration:</p>
  
  <pre><code>Ubunutu:15.10
  Hadoop: 2.7.1
  Java: open-jdk 7u95-2.6.4-0ubuntu0.15.10.1
  </code></pre>