Reply
Expert Contributor
Posts: 121
Registered: ‎11-01-2013

Re: Cannot connect to beeline

This solved my problem....I was using the wrong syntax. Below is the right one...
!connect jdbc:hive2://hostname:10000/default;principal=hive/hostname@PRINCIPAL.COM
username and password blank....

Thanks for helping me out zhang...
Em Jay
New Contributor
Posts: 2
Registered: ‎04-09-2014

Re: Cannot connect to beeline

you can also connect to beeline directly from bash

beeline -u "jdbc:hive2://hostname:10000/;principal=hive/_HOST@PRINCIPAL.COM"

Expert Contributor
Posts: 93
Registered: ‎09-17-2014

Re: Cannot connect to beeline

Hi,

 

I am able to connect to beeline like this

 

!connect jdbc:hive2://

 

But when i type

 

!connect jdbc:hive2://hostname:10000/default org.apache.hive.jdbc.HiveDriver

or !connect jdbc:hive2://hostname:10000/default

 

After giving the username and password
it gives me an error

 

Error: Could not open connection to jdbc:hive2://<host-name>:10000: java.net.ConnectException: Connection refused (state=08S01,code=0)

 

Any suggestions??

 

I am trying to connect with Cognos with this connection String but since it is not getting connected to beeline with ip and port,it is not allowing me to connect in cognos too but without giving ip and port,it works fine in beeline but still giving error in cognos.

 

The Properties in hive-site.xml i have set for hive 2 are:-

 

<property>
  <name>hive.server2.thrift.port</name>
  <value>10000</value>
  <description>Port number of HiveServer2 Thrift interface.
  Can be overridden by setting $HIVE_SERVER2_THRIFT_PORT</description>
</property>

<property>
  <name>hive.server2.thrift.bind.host</name>
  <value>Hostname</value>
  <description>Bind host on which to run the HiveServer2 Thrift interface.
  Can be overridden by setting $HIVE_SERVER2_THRIFT_BIND_HOST</description>
</property>

 

<property>
  <name>hive.metastore.uris</name>
  <value>thrift://hostname:9083</value>
  <description>Thrift uri for the remote metastore. Used by metastore client to connect to remote metastore.</description>
</property>



<property>
  <name>javax.jdo.option.ConnectionURL</name>
  <value>jdbc:mysql://localmachineIP:3306/metastore</value>
  <description>JDBC connect string for a JDBC metastore</description>
</property>


<property>
  <name>javax.jdo.option.ConnectionDriverName</name>
  <value>com.mysql.jdbc.Driver</value>
  <description>Driver class name for a JDBC metastore</description>
</property>

 

Any suggestions?

 

Highlighted
New Contributor
Posts: 4
Registered: ‎03-08-2017

Re: Cannot connect to beeline [SOLVED]

[ Edited ]

[WORKED] 

beeline -u jdbc:hive2://HOSTNAME:10001

Replace HOSTNAME with ur hostname or ip.

 

My case:  CDH5.10.*

no Kerberos authentication

2 node cluster

centos 6.*

Google cloud VM instances

Announcements