<?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 Help to start spark with no errors in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-to-start-spark-with-no-errors/m-p/153627#M24242</link>
    <description>&lt;P&gt;Hi, Im trying to execute queries with Spark SQL over hive tables stored in hdfs single node, but Im with some problems to start spark correctly. I already have hadoop and hive installed and already created the tables with hive with the data stored in hdfs.&lt;/P&gt;&lt;P&gt;I will say what is my hadoop and hive configuration, and hope that someone there already try to execute queries with spark over hive tables and can give a help, and can say what are the step to install spark correctly for this purpose.&lt;/P&gt;&lt;P&gt;I installed hadoop-2.7.1, I extract the files add the environment variables and configured core-site.xml and hdfs-site.xml.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;core-site.xml:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;configuration&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;fs.defaultFS&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;hdfs://localhost:9000&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;hdfs-site.xml:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;configuration&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;dfs.replication&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;1&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/PRE&gt;&lt;P&gt;Then&lt;STRONG&gt; format the namenode&lt;/STRONG&gt; with:&lt;/P&gt;&lt;PRE&gt;hadoop namenode -format&lt;/PRE&gt;&lt;P&gt;Then I &lt;STRONG&gt;start hadoop&lt;/STRONG&gt; with:&lt;/P&gt;&lt;PRE&gt;./start-yarn.sh
./start-dfs.sh&lt;/PRE&gt;&lt;P&gt;And it seems that &lt;STRONG&gt;everything works&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;[hadoopdadmin@hadoop sbin]$ jps
9601 NameNode
9699 DataNode
10003 Jps
9091 ResourceManager
9894 SecondaryNameNode
9191 NodeManager&lt;/PRE&gt;&lt;P&gt;Then after hadoop installed I download hive 1.2.1 and just extract the files and add the environment variables.&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;.bashrc&lt;/STRONG&gt; file is like this now:&lt;/P&gt;&lt;PRE&gt;export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.x86_64
export HADOOP_HOME=/usr/local/hadoop-2.7.1
export HIVE_HOME=/usr/local/apache-hive-1.2.1-bin
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HIVE_HOME/bin&lt;/PRE&gt;&lt;P&gt;To &lt;STRONG&gt;start Hive&lt;/STRONG&gt; I just write hive and it seems that works:&lt;/P&gt;&lt;PRE&gt;[hadoopadmin@hadoopSingleNode ~]$ hive
Logging initialized using configuration in jar:file:/usr/local/apache-hive-1.2.1-bin/lib/hive-common-1.2.1.jar!/hive-log4j.properties

hive&amp;gt; &lt;/PRE&gt;&lt;P&gt;I have some tables in hive that I &lt;STRONG&gt;create&lt;/STRONG&gt; with this command:&lt;/P&gt;&lt;PRE&gt;create  table customer (C_CUSTKEY INT, C_NAME STRING, C_ADDRESS 
STRING, C_NATIONKEY INT, C_PHONE STRING, C_ACCTBAL DOUBLE, C_MKTSEGMENT 
STRING, C_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' 
STORED AS TEXTFILE LOCATION '/tables/customer';&lt;/PRE&gt;&lt;P&gt;Now its time to install spark to query this hive tabes. What Im doing is just download this version "&lt;A href="http://www.apache.org/dyn/closer.lua/spark/spark-1.6.1/spark-1.6.1-bin-hadoop2.6.tgz" target="_blank"&gt;http://www.apache.org/dyn/closer.lua/spark/spark-1.6.1/spark-1.6.1-bin-hadoop2.6.tgz&lt;/A&gt;", extract the files and configure environment variables. After this with spark-shell Im getting a lot of errors.&lt;/P&gt;&lt;P&gt;I already try a lot of things but nothing is working to fix the issues, so someone can see what is not ok in my configurations step or what is missing here?&lt;/P&gt;&lt;P&gt;Errors that are appearing after execute spark-shell command:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3157-img1.png" style="width: 833px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/21029i2435D204A4350A7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="3157-img1.png" alt="3157-img1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3158-img2.png" style="width: 823px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/21030iE5934A6276E6C4EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="3158-img2.png" alt="3158-img2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
    <pubDate>Sun, 18 Aug 2019 12:37:13 GMT</pubDate>
    <dc:creator>joncodin</dc:creator>
    <dc:date>2019-08-18T12:37:13Z</dc:date>
    <item>
      <title>Help to start spark with no errors</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-to-start-spark-with-no-errors/m-p/153627#M24242</link>
      <description>&lt;P&gt;Hi, Im trying to execute queries with Spark SQL over hive tables stored in hdfs single node, but Im with some problems to start spark correctly. I already have hadoop and hive installed and already created the tables with hive with the data stored in hdfs.&lt;/P&gt;&lt;P&gt;I will say what is my hadoop and hive configuration, and hope that someone there already try to execute queries with spark over hive tables and can give a help, and can say what are the step to install spark correctly for this purpose.&lt;/P&gt;&lt;P&gt;I installed hadoop-2.7.1, I extract the files add the environment variables and configured core-site.xml and hdfs-site.xml.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;core-site.xml:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;configuration&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;fs.defaultFS&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;hdfs://localhost:9000&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&amp;lt;/configuration&amp;gt;&lt;/PRE&gt;&lt;P&gt;&lt;STRONG&gt;hdfs-site.xml:&lt;/STRONG&gt;&lt;/P&gt;&lt;PRE&gt;&amp;lt;configuration&amp;gt;
&amp;lt;property&amp;gt;
&amp;lt;name&amp;gt;dfs.replication&amp;lt;/name&amp;gt;
&amp;lt;value&amp;gt;1&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;&lt;/PRE&gt;&lt;P&gt;Then&lt;STRONG&gt; format the namenode&lt;/STRONG&gt; with:&lt;/P&gt;&lt;PRE&gt;hadoop namenode -format&lt;/PRE&gt;&lt;P&gt;Then I &lt;STRONG&gt;start hadoop&lt;/STRONG&gt; with:&lt;/P&gt;&lt;PRE&gt;./start-yarn.sh
./start-dfs.sh&lt;/PRE&gt;&lt;P&gt;And it seems that &lt;STRONG&gt;everything works&lt;/STRONG&gt;:&lt;/P&gt;&lt;PRE&gt;[hadoopdadmin@hadoop sbin]$ jps
9601 NameNode
9699 DataNode
10003 Jps
9091 ResourceManager
9894 SecondaryNameNode
9191 NodeManager&lt;/PRE&gt;&lt;P&gt;Then after hadoop installed I download hive 1.2.1 and just extract the files and add the environment variables.&lt;/P&gt;&lt;P&gt;The &lt;STRONG&gt;.bashrc&lt;/STRONG&gt; file is like this now:&lt;/P&gt;&lt;PRE&gt;export JAVA_HOME=/usr/lib/jvm/jre-1.8.0-openjdk.x86_64
export HADOOP_HOME=/usr/local/hadoop-2.7.1
export HIVE_HOME=/usr/local/apache-hive-1.2.1-bin
export PATH=$PATH:$JAVA_HOME/bin:$HADOOP_HOME/bin:$HIVE_HOME/bin&lt;/PRE&gt;&lt;P&gt;To &lt;STRONG&gt;start Hive&lt;/STRONG&gt; I just write hive and it seems that works:&lt;/P&gt;&lt;PRE&gt;[hadoopadmin@hadoopSingleNode ~]$ hive
Logging initialized using configuration in jar:file:/usr/local/apache-hive-1.2.1-bin/lib/hive-common-1.2.1.jar!/hive-log4j.properties

hive&amp;gt; &lt;/PRE&gt;&lt;P&gt;I have some tables in hive that I &lt;STRONG&gt;create&lt;/STRONG&gt; with this command:&lt;/P&gt;&lt;PRE&gt;create  table customer (C_CUSTKEY INT, C_NAME STRING, C_ADDRESS 
STRING, C_NATIONKEY INT, C_PHONE STRING, C_ACCTBAL DOUBLE, C_MKTSEGMENT 
STRING, C_COMMENT STRING) ROW FORMAT DELIMITED FIELDS TERMINATED BY '|' 
STORED AS TEXTFILE LOCATION '/tables/customer';&lt;/PRE&gt;&lt;P&gt;Now its time to install spark to query this hive tabes. What Im doing is just download this version "&lt;A href="http://www.apache.org/dyn/closer.lua/spark/spark-1.6.1/spark-1.6.1-bin-hadoop2.6.tgz" target="_blank"&gt;http://www.apache.org/dyn/closer.lua/spark/spark-1.6.1/spark-1.6.1-bin-hadoop2.6.tgz&lt;/A&gt;", extract the files and configure environment variables. After this with spark-shell Im getting a lot of errors.&lt;/P&gt;&lt;P&gt;I already try a lot of things but nothing is working to fix the issues, so someone can see what is not ok in my configurations step or what is missing here?&lt;/P&gt;&lt;P&gt;Errors that are appearing after execute spark-shell command:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3157-img1.png" style="width: 833px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/21029i2435D204A4350A7D/image-size/medium?v=v2&amp;amp;px=400" role="button" title="3157-img1.png" alt="3157-img1.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="3158-img2.png" style="width: 823px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/21030iE5934A6276E6C4EB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="3158-img2.png" alt="3158-img2.png" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 18 Aug 2019 12:37:13 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-to-start-spark-with-no-errors/m-p/153627#M24242</guid>
      <dc:creator>joncodin</dc:creator>
      <dc:date>2019-08-18T12:37:13Z</dc:date>
    </item>
    <item>
      <title>Re: Help to start spark with no errors</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-to-start-spark-with-no-errors/m-p/153628#M24243</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3572/joncodin.html" nodeid="3572"&gt;@John Cod&lt;/A&gt; &lt;/P&gt;&lt;P&gt;Spark shell attempts to start a SQL Context by default. The first thing I would check is whether you are pointing Spark at your existing Hive meta store. In your {SPARK_HOME}/conf folder you should have a hive-site.xml file. Make sure you have the following configuraiton:&lt;/P&gt;&lt;PRE&gt;&amp;lt;property&amp;gt;
      &amp;lt;name&amp;gt;hive.metastore.uris&amp;lt;/name&amp;gt;
      &amp;lt;value&amp;gt;thrift://{IP of meta store host}:{port meta store listening}&amp;lt;/value&amp;gt;
&amp;lt;/property&amp;gt;
&lt;/PRE&gt;&lt;P&gt;This should tell Spark Shell to connect to your existing meta store instead of trying to create a default, which is what it looks like it is trying to do. The SQL context should now be able to start up and you should be able to access Hive by using the default SQLContext.&lt;/P&gt;&lt;PRE&gt;val result = sqlContext.sql("SELECT * FROM {hive table name}")
result.show
&lt;/PRE&gt;&lt;P&gt;If the Hive Context was not created by default then do this and retry the query:&lt;/P&gt;&lt;PRE&gt;val hiveContext = new org.apache.spark.sql.hive.HiveContext(sc)&lt;/PRE&gt;</description>
      <pubDate>Mon, 04 Apr 2016 01:45:45 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-to-start-spark-with-no-errors/m-p/153628#M24243</guid>
      <dc:creator>vvaks</dc:creator>
      <dc:date>2016-04-04T01:45:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help to start spark with no errors</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-to-start-spark-with-no-errors/m-p/153629#M24244</link>
      <description>&lt;P&gt;Thank you really. Now it is working! It is just showing some warnings about "version information not found in metastore..." and "failed to get database default returning NoSuchObjectException". But as they are warnings should be working fine, right?&lt;/P&gt;</description>
      <pubDate>Mon, 04 Apr 2016 20:35:41 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Help-to-start-spark-with-no-errors/m-p/153629#M24244</guid>
      <dc:creator>joncodin</dc:creator>
      <dc:date>2016-04-04T20:35:41Z</dc:date>
    </item>
  </channel>
</rss>

