title: Hadoop: how to set HADOOP_YARN_HOME correctly
body: <p>I'm trying to setup hadoop with yarn.</p>
  
  <p>The default yarn.application.classpath property is set like this.
  yarn.application.classpath</p>
  
  <pre><code>&lt;value&gt;
     $HADOOP_CONF_DIR,
     $HADOOP_COMMON_HOME/*,$HADOOP_COMMON_HOME/lib/*,
     $HADOOP_HDFS_HOME/*,$HADOOP_HDFS_HOME/lib/*,
     $HADOOP_MAPRED_HOME/*,$HADOOP_MAPRED_HOME/lib/*,
     $HADOOP_YARN_HOME/*,$HADOOP_YARN_HOME/lib/*,
  &lt;/value&gt;
  </code></pre>
  
  <p>With this configuration all MR jobs are failing. If I substitute it with this (HADOOP_YARN_HOME is substituted for its value) everything works fine.</p>
  
  <pre><code>&lt;name&gt;yarn.application.classpath&lt;/name&gt;
  &lt;value&gt;
     $HADOOP_CONF_DIR,
     $HADOOP_COMMON_HOME/*,$HADOOP_COMMON_HOME/lib/*,
     $HADOOP_HDFS_HOME/*,$HADOOP_HDFS_HOME/lib/*,
     $HADOOP_MAPRED_HOME/*,$HADOOP_MAPRED_HOME/lib/*,
     /usr/lib/hadoop-yarn/*,/usr/lib/hadoop-yarn/lib/*,
  &lt;/value&gt;
  </code></pre>
  
  <p>So, I suspect that resourcemanager has an incorrect value of $HADOOP_YARN_HOME set somewhere. I've tried setting it in yarn-env.sh, hadoop-env.sh and /etc/default/hadoop-yarn, but jobs keep failing.</p>
  
  <p>My question is, where do I have to set $HADOOP_YARN_HOME variable?</p>
  
  <p>P.D. I'm using CDH5.</p>