title: Hadoop environment variables: when are they initialized?
body: <p>Using Hortonworks HDP 2.1 (Hadoop 2.40) either using the HDP Sandbox virtual machine or installing a multinodes cluster (CentOS 6.5). Hadoop itself is working OK, all the Java MapReduce programs, Pig, Hive, HBase are working OK.</p>
  
  <p>When I SSH (as root user) to the Hadoop nodes (either masters or slaves), I am surprised that various Hadoop environment variables are not set (HADOOP_HOME, HADOOP_CONF_DIR, HADOOP_xxx, HIVE_HOME, PIG_HOME, etc.)</p>
  
  <p>I suppose these environments variables are set during runtime. When a specific task is executed. Example:</p>
  
  <pre><code># yarn jar MyTestMR.jar MyMRTestClass
  </code></pre>
  
  <p>What is the reason for these Hadoop variables not to be set permanently? Is there any way (and harm?) to make these variable to retain their value? This can help for documentation purpose and easier to remember. For example, HADOOP_LOG_DIR, YARN_LOG_DIR is easier to remember than their physical location (/var/log/ ... something)</p>
  
  <p>Thanks in advance for any help</p>