Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

Hive Error in Zeppelin: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (Connection refused)

Hive Error in Zeppelin: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (Connection refused)

New Contributor

I have installed Zeppelin in a single cluster (Pseudo-Distributed Mode) Hadoop. Then, I defined a new interpreter in Zeppelin to be able to run HIVE queries as seen in Figure hive.png

Then, I ran a Zeppelin notebook with the a simple hive command, but there is Error as seen in Figure Error_message.png

I appreciate any help.

42900-error-message.png

42899-hive.png

4 REPLIES 4

Re: Hive Error in Zeppelin: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (Connection refused)

Super Collaborator

Hi @Mike Bit,

default.url needs to be pointed to the hiveserver URL, you can obtain this value from Ambari ( in hive there is a copy symbol named Hive Server2 JDBC URL) or just replace the local host with the thrift server name /IP so that hive will be able to connect.

jdbc:hive2://<HiveServer2 Thrift/MetaStore >:10000

43821-hiveserver2url.png

Hope this helps !!

Re: Hive Error in Zeppelin: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (Connection refused)

New Contributor

Dear @bkosaraju, I have no Ambari. I have installed Hadoop, Hive and Zeppelin in Pseudo-Distributed Mode. So, I used "jdbc:hive2://localhost:10000" as single hadoop cluster, but I am getting the same error.

Re: Hive Error in Zeppelin: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (Connection refused)

Super Collaborator

Hi @Mike Bit,

Can you please check that are you able to listen on 10000 port for hive.

you can run the following command and get to know on what IP:PORT the HiveServer is running

netstat -anp | grep 10000 

if the hiveserver is not listening on 127.0.0.1 then change the URL IP to the IP which it is listening from above command.

other alternative is to get to know the port - refer the hive-site.xml file so that associated port number will be listed there.

Hope this helps !!

Re: Hive Error in Zeppelin: java.sql.SQLException: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000: java.net.ConnectException: Connection refused (Connection refused)

New Contributor

Hi @bkosaraju,

I have used netstat for port 10000, but there is no listening. Also, I have changed ufw firewall by allowing all the traffic from port 10000 and 10001, but still same error message.

Also, I configure hive-site.xml as follows:

   <property>
      <name>javax.jdo.option.ConnectionURL</name>
      <value>jdbc:mysql://localhost/metastore?createDatabaseIfNotExist=true</value>
      <description>metadata is stored in a MySQL server</description>
   </property>

   <property>
      <name>javax.jdo.option.ConnectionDriverName</name>
      <value>com.mysql.jdbc.Driver</value>
      <description>MySQL JDBC driver class</description>
   </property>

<property>
<name>hive.metastore.warehouse.dir</name>
<value>/user/hive/warehouse</value>
<description>location of default database for the warehouse</description>
</property>
 
   <property>
	<name>javax.jdo.option.ConnectionUserName</name>
      <value>hiveuser</value>
      <description>user name for connecting to mysql server</description>
   </property>
   <property>
      <name>javax.jdo.option.ConnectionPassword</name>
      <value>hivepassword</value>
      <description>password for connecting to mysql server</description>
   </property>

<property>
 <name>hive.server2.thrift.min.worker.threads</name>
 <value>5</value>
 <description>Minimum number of worker threads</description>
 </property>

 <property>
  <name>hive.server2.thrift.max.worker.threads</name>
  <value>500</value>
  <description>Maximum number of worker threads</description>
 </property>

 <property>
  <name>hive.server2.thrift.port</name>
  <value>10000</value>
  <description>TCP port number to listen on</description>
 </property>

 <property>
  <name>hiver.server2.thrift.bind.host</name>
  <value>192.168.19.130</value>
  <description>TCP interface to bind to</description>
 </property>

  <property>
   <name>hiver.server2.thrift.bind.host</name>
   <value>192.168.19.130</value>
   <description>TCP interface to bind to</description>
  </property>

  <property>
   <name>hive.server2.transport.mode</name>
   <value>binary</value>
   <description>Set to http to enable HTTP transport mode</description>
  </property>

  <property>
   <name>hive.server2.thrift.http.port</name>
   <value>10001</value>
   <description>HTTP port number to listen on</description>
  </property>

But, still same error.

Also, I am running both hive and $HIVE_HOME/bin/hiveserver2 but still same error massage. :-(

Don't have an account?
Coming from Hortonworks? Activate your account here