<?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: Set environment variable in CDH for Spark executors in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Set-environment-variable-in-CDH-for-Spark-executors/m-p/62612#M71936</link>
    <description>This is the order of precedence for configurations that Spark will use:

- Properties set on SparkConf or SparkContext in code
- Arguments passed to spark-submit, spark-shell, or pyspark at run time
- Properties set in /etc/spark/conf/spark-defaults.conf, a specified properties file or in Cloudera Manager safety valve
- Environment variables exported or set in scripts

* For properties that apply to all jobs, use spark-defaults.conf, for properties that are constant and specific to a single or a few applications use SparkConf or --properties-file, for properties that change between runs use command line arguments.</description>
    <pubDate>Fri, 08 Dec 2017 14:41:36 GMT</pubDate>
    <dc:creator>GaryWO</dc:creator>
    <dc:date>2017-12-08T14:41:36Z</dc:date>
    <item>
      <title>Set environment variable in CDH for Spark executors</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Set-environment-variable-in-CDH-for-Spark-executors/m-p/62323#M71934</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have been trying to set environment variable in Spark.&amp;nbsp; However there seems to be problems.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use HDFS/YARN from CDH 5.12, and a &lt;STRONG&gt;standalone Spark (v2.2.0)&lt;/STRONG&gt; and run together with &lt;STRONG&gt;Crail&lt;/STRONG&gt; (&lt;A href="https://github.com/zrlio/crail).&amp;nbsp;" target="_blank"&gt;https://github.com/zrlio/crail).&amp;nbsp;&lt;/A&gt; However, there is&amp;nbsp;error in the YARN logs saying that Crail's library path is not included in&amp;nbsp;&lt;SPAN&gt;java.library.path.&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;...&lt;/P&gt;&lt;P&gt;17/11/27 10:57:50 INFO ibm.crail: crail.storage.rdma.type passive&lt;/P&gt;&lt;P&gt;17/11/27 10:57:50 INFO ibm.disni: creating RdmaProvider of type 'nat'&lt;BR /&gt;&lt;STRONG&gt;Exception in thread "dag-scheduler-event-loop" java.lang.UnsatisfiedLinkError: no disni in java.library.path&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1867)&lt;BR /&gt;at java.lang.Runtime.loadLibrary0(Runtime.java:870)&lt;BR /&gt;at java.lang.System.loadLibrary(System.java:1122)&lt;/P&gt;&lt;P&gt;....&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I found in a post from Crail's user group that it can be fixed by setting the following variable:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;LD_LIBRARY_PATH=/opt/crail/crail-1.0-bin/lib:$LD_LIBRARY_PATH&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;or:&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;spark.executor.extraJavaOptions -Djava.library.path=/opt/crail/crail-1.0-bin/lib&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Here is the post:&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://groups.google.com/forum/#!topic/zrlio-users/_P5NeH3iHxE" target="_blank"&gt;https://groups.google.com/forum/#!topic/zrlio-users/_P5NeH3iHxE&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Can you please guide where I should set the environment variable inside CDH?&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I tried to set the environment variable inside ~/.bashrc and spark-env.sh.&amp;nbsp; However, it didn't work, because it seems CDH will reset all enviroment variables when starting services.&amp;nbsp; &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I also tried setting the environment variable in all the places I can find inside CDH, including the configuration of Environments in&amp;nbsp;Cloudera Management Service, YARN, and HDFS.&amp;nbsp; But the problem is still not solved.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Kevin&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Sep 2022 12:34:44 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Set-environment-variable-in-CDH-for-Spark-executors/m-p/62323#M71934</guid>
      <dc:creator>THUKevin</dc:creator>
      <dc:date>2022-09-16T12:34:44Z</dc:date>
    </item>
    <item>
      <title>Re: Set environment variable in CDH for Spark executors</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Set-environment-variable-in-CDH-for-Spark-executors/m-p/62399#M71935</link>
      <description>&lt;P&gt;To simplify the question:&amp;nbsp; how can I set multiple Environment Variables under "yarn.nodemanager.admin-en"?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 01 Dec 2017 02:04:08 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Set-environment-variable-in-CDH-for-Spark-executors/m-p/62399#M71935</guid>
      <dc:creator>THUKevin</dc:creator>
      <dc:date>2017-12-01T02:04:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set environment variable in CDH for Spark executors</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Set-environment-variable-in-CDH-for-Spark-executors/m-p/62612#M71936</link>
      <description>This is the order of precedence for configurations that Spark will use:

- Properties set on SparkConf or SparkContext in code
- Arguments passed to spark-submit, spark-shell, or pyspark at run time
- Properties set in /etc/spark/conf/spark-defaults.conf, a specified properties file or in Cloudera Manager safety valve
- Environment variables exported or set in scripts

* For properties that apply to all jobs, use spark-defaults.conf, for properties that are constant and specific to a single or a few applications use SparkConf or --properties-file, for properties that change between runs use command line arguments.</description>
      <pubDate>Fri, 08 Dec 2017 14:41:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Set-environment-variable-in-CDH-for-Spark-executors/m-p/62612#M71936</guid>
      <dc:creator>GaryWO</dc:creator>
      <dc:date>2017-12-08T14:41:36Z</dc:date>
    </item>
  </channel>
</rss>

