title: When running with master 'yarn' either HADOOP_CONF_DIR or YARN_CONF_DIR must be set in the environment
body: <p>I am trying to run Spark using yarn and I am running into this error:</p>
  
  <p>Exception in thread "main" java.lang.Exception: When running with master 'yarn' either <code>HADOOP_CONF_DIR</code> or <code>YARN_CONF_DIR</code> must be set in the environment.</p>
  
  <p>I am not sure where the "environment" is (what specific file?).  I tried using:</p>
  
  <pre><code>export HADOOP_CONF_DIR=$HADOOP_HOME/etc/hadoop
  export YARN_CONF_DIR=$HADOOP_HOME/etc/hadoop
  </code></pre>
  
  <p>in the bash_profile, but this doesn't seem to help. </p>