<?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: Error while connecting Hive using JDBC in R script in Archives of Support Questions (Read Only)</title>
    <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-while-connecting-Hive-using-JDBC-in-R-script/m-p/231836#M72932</link>
    <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/51299/saipardhu147.html" nodeid="51299"&gt;@Sai Kumar Manapragada&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://xx.x.x.x:10000: java.net.ConnectException: Connection refused (Connection refused)&lt;/PRE&gt;&lt;P&gt;As you are getting the Above error hence it will be worth checking if the HiveServer2 IP And Port is accessible from the machine where you are running the R Script or not?&lt;/P&gt;&lt;P&gt;So please check if Hive Server2 port 10000 is accessible from the R Script host.  This is to isolate any Network Issue or Firewall Issues.&lt;/P&gt;&lt;PRE&gt;# telnet 10.0.1.10 10000
(OR)
# nc -v 10.0.1.10 10000&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Also on the HiveServer2 host please check if the IP Address is correct and the Port 10000 is opened on the correct network interface.&lt;/P&gt;&lt;PRE&gt;# service iptables status
# netstat -tnlpa | grep 10000
# ifconfig | grep 10.0.1.10&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Also please check your HiveSerevr2 (hive-site.xml) config to find out if the Listen Address is set correctly to point to the correct IP / Hostname.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Dec 2017 06:37:19 GMT</pubDate>
    <dc:creator>jsensharma</dc:creator>
    <dc:date>2017-12-29T06:37:19Z</dc:date>
    <item>
      <title>Error while connecting Hive using JDBC in R script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-while-connecting-Hive-using-JDBC-in-R-script/m-p/231835#M72931</link>
      <description>&lt;P&gt;Hi &lt;/P&gt;&lt;P&gt;I have an R script that tries to connect to hive using JDBC to pull tables from the hive and perform some processing on the data.&lt;/P&gt;&lt;P&gt;However I'm getting an error at the connection part and am not really sure how to resolve this. Tried different sources on net but couldn't find an answer.&lt;/P&gt;&lt;P&gt;Below is my R code where the error appears and also the error seen on the screen.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;cp = c(paste0(BASE_PATH, JAR_DIRECTORY, HADOOP_COMMON_JAR), paste0(BASE_PATH, JAR_DIRECTORY, HIVE_JDBC_JAR)) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;.jinit(classpath=cp) &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;drv &amp;lt;- JDBC("org.apache.hive.jdbc.HiveDriver", paste0(BASE_PATH, JAR_DIRECTORY, HIVE_JDBC_JAR), identifier.quote="`") &lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;conn &amp;lt;- dbConnect(drv, "jdbc:hive2://10.0.1.10:10000")&lt;/STRONG&gt; //Error is here&lt;/P&gt;&lt;P&gt;Error:&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Error in .jcall(drv@jdrv, "Ljava/sql/Connection;", "connect", as.character(url)[1],  :&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;
  java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://xx.x.x.x:10000: &lt;/STRONG&gt;&lt;B&gt;java.net.ConnectException: Connection refused (Connection refused)&lt;/B&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Calls: dbConnect -&amp;gt; dbConnect -&amp;gt; .local -&amp;gt; .jcall -&amp;gt; .jcheck -&amp;gt; .&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Call
Execution halted&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Any help would be appreciated and I'm happy to provide more insights if required&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 06:13:36 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-while-connecting-Hive-using-JDBC-in-R-script/m-p/231835#M72931</guid>
      <dc:creator>saipardhu147</dc:creator>
      <dc:date>2017-12-29T06:13:36Z</dc:date>
    </item>
    <item>
      <title>Re: Error while connecting Hive using JDBC in R script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-while-connecting-Hive-using-JDBC-in-R-script/m-p/231836#M72932</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/51299/saipardhu147.html" nodeid="51299"&gt;@Sai Kumar Manapragada&lt;/A&gt;&lt;/P&gt;&lt;PRE&gt;java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://xx.x.x.x:10000: java.net.ConnectException: Connection refused (Connection refused)&lt;/PRE&gt;&lt;P&gt;As you are getting the Above error hence it will be worth checking if the HiveServer2 IP And Port is accessible from the machine where you are running the R Script or not?&lt;/P&gt;&lt;P&gt;So please check if Hive Server2 port 10000 is accessible from the R Script host.  This is to isolate any Network Issue or Firewall Issues.&lt;/P&gt;&lt;PRE&gt;# telnet 10.0.1.10 10000
(OR)
# nc -v 10.0.1.10 10000&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Also on the HiveServer2 host please check if the IP Address is correct and the Port 10000 is opened on the correct network interface.&lt;/P&gt;&lt;PRE&gt;# service iptables status
# netstat -tnlpa | grep 10000
# ifconfig | grep 10.0.1.10&lt;/PRE&gt;&lt;P&gt;.&lt;/P&gt;&lt;P&gt;Also please check your HiveSerevr2 (hive-site.xml) config to find out if the Listen Address is set correctly to point to the correct IP / Hostname.&lt;/P&gt;&lt;P&gt;.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 06:37:19 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-while-connecting-Hive-using-JDBC-in-R-script/m-p/231836#M72932</guid>
      <dc:creator>jsensharma</dc:creator>
      <dc:date>2017-12-29T06:37:19Z</dc:date>
    </item>
    <item>
      <title>Re: Error while connecting Hive using JDBC in R script</title>
      <link>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-while-connecting-Hive-using-JDBC-in-R-script/m-p/231837#M72933</link>
      <description>&lt;P&gt;&lt;A rel="user" href="https://community.cloudera.com/users/3418/jsensharma.html" nodeid="3418"&gt;@Jay Kumar SenSharma&lt;/A&gt;. Thanks, the connection to 10000 was refused when I did telnet. Also i don't see anything running on that port when I did netstat. &lt;/P&gt;&lt;P&gt;Apparently, I didn't know that hiveserver2 must be started explicitly and hence was the error. &lt;/P&gt;&lt;P&gt;Do you know what is the property that needs to added to hive-site.xml inorder for me to access the web UI?&lt;/P&gt;&lt;P&gt;Nevertheless, thank you very much. You've helped me great.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 09:44:49 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Archives-of-Support-Questions/Error-while-connecting-Hive-using-JDBC-in-R-script/m-p/231837#M72933</guid>
      <dc:creator>saipardhu147</dc:creator>
      <dc:date>2017-12-29T09:44:49Z</dc:date>
    </item>
  </channel>
</rss>

