<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: How to avoid variables in hadoop-env being called more than once? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-avoid-variables-in-hadoop-env-being-called-more-than/m-p/95697#M9057</link>
    <description>&lt;P&gt;Wonderful, exactly what I was looking for - thank you &lt;A href="http://community.hortonworks.com/questions/1732/how-to-avoid-variables-in-hadoop-env-being-called.html#"&gt;@Sourygna Luangsay&lt;/A&gt; &amp;amp; &lt;A href="http://community.hortonworks.com/questions/1732/how-to-avoid-variables-in-hadoop-env-being-called.html#"&gt;@Neeraj Sabharwal&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 23 Oct 2015 00:50:56 GMT</pubDate>
    <dc:creator>dprichici</dc:creator>
    <dc:date>2015-10-23T00:50:56Z</dc:date>
    <item>
      <title>How to avoid variables in hadoop-env being called more than once?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-avoid-variables-in-hadoop-env-being-called-more-than/m-p/95694#M9054</link>
      <description>&lt;P&gt;In some situations, for example when using a profiling tool, the fact that hadoop-env is called more than once is a problem, because it starts multiple instances of the profiler (in the way of HADOOP-9873, HADOOP-9902 &amp;amp; HADOOP-11010).&lt;/P&gt;&lt;P&gt;Is there a way to avoid the env variables in hadoop-env being called more than once?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Oct 2015 23:41:37 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-avoid-variables-in-hadoop-env-being-called-more-than/m-p/95694#M9054</guid>
      <dc:creator>dprichici</dc:creator>
      <dc:date>2015-10-20T23:41:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid variables in hadoop-env being called more than once?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-avoid-variables-in-hadoop-env-being-called-more-than/m-p/95695#M9055</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/53/dprichici.html" nodeid="53"&gt;@dprichici@hortonworks.com&lt;/A&gt; , The solution is in your question.&lt;/P&gt;&lt;P&gt;Are you looking for something in particluar? &lt;/P&gt;&lt;PRE&gt;diff --git a/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh b/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh
index ecab38b..d36b370 100644
--- a/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh
+++ b/hadoop-common-project/hadoop-common/src/main/conf/hadoop-env.sh
@@ -23,6 +23,9 @@
 # set JAVA_HOME in this file, so that it is correctly defined on
 # remote nodes.
 
+[ X"$HADOOP_ENV_INITED" = X"true" ] &amp;amp;&amp;amp; return
+export HADOOP_ENV_INITED="true"
+
 # The java implementation to use.
 export JAVA_HOME=${JAVA_HOME}
 &lt;/PRE&gt;</description>
      <pubDate>Wed, 21 Oct 2015 18:29:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-avoid-variables-in-hadoop-env-being-called-more-than/m-p/95695#M9055</guid>
      <dc:creator>nsabharwal</dc:creator>
      <dc:date>2015-10-21T18:29:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid variables in hadoop-env being called more than once?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-avoid-variables-in-hadoop-env-being-called-more-than/m-p/95696#M9056</link>
      <description>&lt;P&gt;One thing I did in the past to avoid that script to be loaded multiple times was editing that script and add a kind of global variable to detect if the script needs to be executed again.&lt;/P&gt;&lt;P&gt;Something like that (put that at the beginning of the script, just after the first line #!/bin/bash):&lt;/P&gt;&lt;P&gt;[ "x$SCRIPT_HADOOP_ENV_LOADED" = "x1" ] &amp;amp;&amp;amp; return&lt;/P&gt;&lt;P&gt;export SCRIPT_HADOOP_ENV_LOADED=1&lt;/P&gt;</description>
      <pubDate>Wed, 21 Oct 2015 18:46:54 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-avoid-variables-in-hadoop-env-being-called-more-than/m-p/95696#M9056</guid>
      <dc:creator>sluangsay</dc:creator>
      <dc:date>2015-10-21T18:46:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to avoid variables in hadoop-env being called more than once?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-avoid-variables-in-hadoop-env-being-called-more-than/m-p/95697#M9057</link>
      <description>&lt;P&gt;Wonderful, exactly what I was looking for - thank you &lt;A href="http://community.hortonworks.com/questions/1732/how-to-avoid-variables-in-hadoop-env-being-called.html#"&gt;@Sourygna Luangsay&lt;/A&gt; &amp;amp; &lt;A href="http://community.hortonworks.com/questions/1732/how-to-avoid-variables-in-hadoop-env-being-called.html#"&gt;@Neeraj Sabharwal&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 23 Oct 2015 00:50:56 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/How-to-avoid-variables-in-hadoop-env-being-called-more-than/m-p/95697#M9057</guid>
      <dc:creator>dprichici</dc:creator>
      <dc:date>2015-10-23T00:50:56Z</dc:date>
    </item>
  </channel>
</rss>

