<?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: Help Spark Master for Sandbox VM? in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-Spark-Master-for-Sandbox-VM/m-p/163614#M24816</link>
    <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/3881/vrsanaidu.html" nodeid="3881"&gt;@Rajendra Vechalapu&lt;/A&gt;, you can omit setting master in your source, see &lt;A href="https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/SparkPi.scala"&gt;this example&lt;/A&gt;:&lt;/P&gt;&lt;PRE&gt;val conf = new SparkConf().setAppName("Spark Pi")
val spark = new SparkContext(conf)&lt;/PRE&gt;&lt;P&gt;You can then launch your application using &lt;A href="http://spark.apache.org/docs/latest/submitting-applications.html"&gt;spark-submit&lt;/A&gt; and provide the master there there using "--master" and "--deploy-mode" options. Refer to &lt;A href="http://spark.apache.org/docs/latest/programming-guide.html"&gt;Spark programming guide&lt;/A&gt; for this and other useful hints.&lt;/P&gt;&lt;P&gt;Edit: When you run spark-submit on Sandbox, be sure to supply additional arguments for master, num-executors, driver-memory, executor-memory, and executor-cores as given below. Note that larger values for last 4 arguments will not work on the Sandbox! Follow (and you can also try) this example computing Pi in Python (as any user who has access to HDFS/Yarn):&lt;/P&gt;&lt;PRE&gt;cd /usr/hdp/current/spark-client/ 
spark-submit --master yarnclient --num-executors 1 --driver-memory 512m --executor-memory 512m --executor-cores 1 examples/src/main/python/pi.py 10
&lt;/PRE&gt;&lt;P&gt;"--master yarncluster" works too. You can also set these 4 in spark-env in Ambari. They are already there but commented out, and not all with values like here. See also &lt;A href="http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.0/bk_spark-guide/content/ch_introduction-spark.html"&gt;Spark guide on HDP&lt;/A&gt;.&lt;/P&gt;</description>
    <pubDate>Sun, 10 Apr 2016 08:36:33 GMT</pubDate>
    <dc:creator>pminovic</dc:creator>
    <dc:date>2016-04-10T08:36:33Z</dc:date>
    <item>
      <title>Help Spark Master for Sandbox VM?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-Spark-Master-for-Sandbox-VM/m-p/163613#M24815</link>
      <description>&lt;P&gt;I have downloaded sandbox VM and it is working fine, now i need to create SC manually, like with below code, but how would i know Spark Master name here instead of local.&lt;/P&gt;&lt;P&gt;val conf = new SparkConf().setMaster("local").setAppName("My App")&lt;/P&gt;</description>
      <pubDate>Sun, 10 Apr 2016 00:06:50 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-Spark-Master-for-Sandbox-VM/m-p/163613#M24815</guid>
      <dc:creator>vrsanaidu</dc:creator>
      <dc:date>2016-04-10T00:06:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help Spark Master for Sandbox VM?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-Spark-Master-for-Sandbox-VM/m-p/163614#M24816</link>
      <description>&lt;P&gt;Hi &lt;A rel="user" href="https://community.cloudera.com/users/3881/vrsanaidu.html" nodeid="3881"&gt;@Rajendra Vechalapu&lt;/A&gt;, you can omit setting master in your source, see &lt;A href="https://github.com/apache/spark/blob/master/examples/src/main/scala/org/apache/spark/examples/SparkPi.scala"&gt;this example&lt;/A&gt;:&lt;/P&gt;&lt;PRE&gt;val conf = new SparkConf().setAppName("Spark Pi")
val spark = new SparkContext(conf)&lt;/PRE&gt;&lt;P&gt;You can then launch your application using &lt;A href="http://spark.apache.org/docs/latest/submitting-applications.html"&gt;spark-submit&lt;/A&gt; and provide the master there there using "--master" and "--deploy-mode" options. Refer to &lt;A href="http://spark.apache.org/docs/latest/programming-guide.html"&gt;Spark programming guide&lt;/A&gt; for this and other useful hints.&lt;/P&gt;&lt;P&gt;Edit: When you run spark-submit on Sandbox, be sure to supply additional arguments for master, num-executors, driver-memory, executor-memory, and executor-cores as given below. Note that larger values for last 4 arguments will not work on the Sandbox! Follow (and you can also try) this example computing Pi in Python (as any user who has access to HDFS/Yarn):&lt;/P&gt;&lt;PRE&gt;cd /usr/hdp/current/spark-client/ 
spark-submit --master yarnclient --num-executors 1 --driver-memory 512m --executor-memory 512m --executor-cores 1 examples/src/main/python/pi.py 10
&lt;/PRE&gt;&lt;P&gt;"--master yarncluster" works too. You can also set these 4 in spark-env in Ambari. They are already there but commented out, and not all with values like here. See also &lt;A href="http://docs.hortonworks.com/HDPDocuments/HDP2/HDP-2.4.0/bk_spark-guide/content/ch_introduction-spark.html"&gt;Spark guide on HDP&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Apr 2016 08:36:33 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-Spark-Master-for-Sandbox-VM/m-p/163614#M24816</guid>
      <dc:creator>pminovic</dc:creator>
      <dc:date>2016-04-10T08:36:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help Spark Master for Sandbox VM?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-Spark-Master-for-Sandbox-VM/m-p/163615#M24817</link>
      <description>&lt;P&gt;Thx , Working.&lt;/P&gt;</description>
      <pubDate>Sun, 10 Apr 2016 22:26:01 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-Spark-Master-for-Sandbox-VM/m-p/163615#M24817</guid>
      <dc:creator>vrsanaidu</dc:creator>
      <dc:date>2016-04-10T22:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Help Spark Master for Sandbox VM?</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-Spark-Master-for-Sandbox-VM/m-p/163616#M24818</link>
      <description>&lt;P&gt;If I want to run from external of the VM, for example, in Eclipse, what's the master ip and port? Thanks.&lt;/P&gt;</description>
      <pubDate>Sun, 24 Apr 2016 18:55:07 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-Spark-Master-for-Sandbox-VM/m-p/163616#M24818</guid>
      <dc:creator>jr_chio</dc:creator>
      <dc:date>2016-04-24T18:55:07Z</dc:date>
    </item>
  </channel>
</rss>

