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.

connection issue from beeline to hive

Highlighted

connection issue from beeline to hive

Contributor

Hi,

 

I am unable to connect from beeline to hive meatstore. i am attaching the error which was thrown.

 

Please help me resolve this issue.

 

Thanks in advance

 

 

 

[centos@e1 ~]$ beeline
Beeline version 1.2.1.spark2 by Apache Hive
beeline> !connect jdbc:hive2://server1.abc.com:10000
Connecting to jdbc:hive2://server1.abc.com:10000
Enter username for jdbc:hive2://server1.abc.com:10000: hive
Enter password for jdbc:hive2://server1.abc.com:10000: ********
2018-09-10 12:26:25 INFO  Utils:310 - Supplied authorities: server1.abc.com:10000
2018-09-10 12:26:25 INFO  Utils:397 - Resolved authority: server1.abc.com:10000
2018-09-10 12:26:25 INFO  HiveConnection:203 - Will try to open client transport with JDBC Uri: jdbc:hive2://server1.abc.com:10000
2018-09-10 12:26:25 ERROR HiveConnection:593 - Error opening session
org.apache.thrift.TApplicationException: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default})
        at org.apache.thrift.TApplicationException.read(TApplicationException.java:111)
        at org.apache.thrift.TServiceClient.receiveBase(TServiceClient.java:79)
        at org.apache.hive.service.cli.thrift.TCLIService$Client.recv_OpenSession(TCLIService.java:156)
        at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:143)
        at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:583)
        at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:192)
        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:142)
        at org.apache.hive.beeline.DatabaseConnection.getConnection(DatabaseConnection.java:207)
        at org.apache.hive.beeline.Commands.connect(Commands.java:1149)
        at org.apache.hive.beeline.Commands.connect(Commands.java:1070)
        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.dispatch(BeeLine.java:970)
        at org.apache.hive.beeline.BeeLine.execute(BeeLine.java:813)
        at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:771)
        at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:484)
        at org.apache.hive.beeline.BeeLine.main(BeeLine.java:467)
Error: Could not establish connection to jdbc:hive2://server1.abc.com:10000: Required field 'client_protocol' is unset! Struct:TOpenSessionReq(client_protocol:null, configuration:{use:database=default}) (state=08S01,code=0)
0: jdbc:hive2://server1.abc.com:10000 (closed)>

 

1 REPLY 1

Re: connection issue from beeline to hive

Guru
Please try one of below:

1. in beeline run:
!connect 'jdbc:hive2://server1.abc.com:10000/default'

2. from shell command line:
beeline -u 'jdbc:hive2://server1.abc.com:10000/default'

See if that helps