Reply
Expert Contributor
Posts: 126
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?

 

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

New Contributor
Posts: 4
Registered: ‎04-04-2018

Re: Cannot connect to beeline

I am facing the same issue. Please note that I have valid kinit token

 

 

Here is the output from klist command

Ticket cache: FILE:/tmp/krb5cc_10002
Default principal: dpugazhe@RUSH.EDU

Valid starting Expires Service principal
04/25/2018 06:27:16 04/25/2018 16:27:16 krbtgt/RUSH.EDU@RUSH.EDU
renew until 05/02/2018 06:27:16

 

 

Please find the connection string and output command.

 

 

beeline> !connect jdbc:hive2://localhost:10000/default;principal=hive/_HOST@.RUSH.EDU
scan complete in 1ms
Connecting to jdbc:hive2://localhost:10000/default;principal=hive/_HOST@.RUSH.EDU
18/04/25 08:25:23 [main]: ERROR transport.TSaslTransport: SASL negotiation failure
javax.security.sasl.SaslException: GSS initiate failed [Caused by GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7))]
at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:211)
at org.apache.thrift.transport.TSaslClientTransport.handleSaslStartMessage(TSaslClientTransport.java:94)
at org.apache.thrift.transport.TSaslTransport.open(TSaslTransport.java:271)
at org.apache.thrift.transport.TSaslClientTransport.open(TSaslClientTransport.java:37)
at org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport$1.run(TUGIAssumingTransport.java:52)
at org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport$1.run(TUGIAssumingTransport.java:49)
at java.security.AccessController.doPrivileged(Native Method)
at javax.security.auth.Subject.doAs(Subject.java:422)
at org.apache.hadoop.security.UserGroupInformation.doAs(UserGroupInformation.java:1917)
at org.apache.hadoop.hive.thrift.client.TUGIAssumingTransport.open(TUGIAssumingTransport.java:49)
at org.apache.hive.jdbc.HiveConnection.openTransport(HiveConnection.java:204)
at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:169)
at org.apache.hive.jdbc.HiveDriver.connect(HiveDriver.java:105)
at java.sql.DriverManager.getConnection(DriverManager.java:664)
at java.sql.DriverManager.getConnection(DriverManager.java:208)
at org.apache.hive.beeline.DatabaseConnection.connect(DatabaseConnection.java:146)
at org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:211)
at org.apache.hive.beeline.Commands.connect(Commands.java:1526)
at org.apache.hive.beeline.Commands.connect(Commands.java:1421)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hive.beeline.ReflectiveCommandHandler.execute(ReflectiveCommandHandler.java:52)
at org.apache.hive.beeline.BeeLine.execCommandWithPrefix(BeeLine.java:1135)
at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:1174)
at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:1010)
at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:922)
at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:518)
at org.apache.hive.beeline.BeeLine.main(BeeLine.java:501)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.hadoop.util.RunJar.run(RunJar.java:221)
at org.apache.hadoop.util.RunJar.main(RunJar.java:136)
Caused by: GSSException: No valid credentials provided (Mechanism level: Server not found in Kerberos database (7))
at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:770)
at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:248)
at sun.security.jgss.GSSContextImpl.initSecContext(GSSContextImpl.java:179)
at com.sun.security.sasl.gsskerb.GssKrb5Client.evaluateChallenge(GssKrb5Client.java:192)
... 35 more
Caused by: KrbException: Server not found in Kerberos database (7)
at sun.security.krb5.KrbTgsRep.<init>(KrbTgsRep.java:70)
at sun.security.krb5.KrbTgsReq.getReply(KrbTgsReq.java:251)
at sun.security.krb5.KrbTgsReq.sendAndGetCreds(KrbTgsReq.java:262)
at sun.security.krb5.internal.CredentialsUtil.serviceCreds(CredentialsUtil.java:308)
at sun.security.krb5.internal.CredentialsUtil.acquireServiceCreds(CredentialsUtil.java:126)
at sun.security.krb5.Credentials.acquireServiceCreds(Credentials.java:458)
at sun.security.jgss.krb5.Krb5Context.initSecContext(Krb5Context.java:693)
... 38 more
Caused by: KrbException: Identifier doesn't match expected value (906)
at sun.security.krb5.internal.KDCRep.init(KDCRep.java:140)
at sun.security.krb5.internal.TGSRep.init(TGSRep.java:65)
at sun.security.krb5.internal.TGSRep.<init>(TGSRep.java:60)
at sun.security.krb5.KrbTgsRep.<init>(KrbTgsRep.java:55)
... 44 more
Unknown HS2 problem when communicating with Thrift server.
Error: Could not open client transport with JDBC Uri: jdbc:hive2://localhost:10000/default;principal=hive/_HOST@.RUSH.EDU: GSS initiate failed (state=08S01,code=0)

 

 

 

Highlighted
New Contributor
Posts: 2
Registered: ‎07-11-2018

Re: Cannot connect to beeline

hi manikumar

 

are you solved the problem

 

i have the same problem , i cant write password , they told me error

 

please help me if ur code work send it to me

Announcements