Support Questions

Find answers, ask questions, and share your expertise

Beeline connection throws error

avatar
Contributor

Transport mode: http

hive server 2 running port 10001, hive service check from ambari passed succesfully

url : "jdbc:hive2://hostname:port/default;transportMode=http;httppath=cliservice"

able to login through hive cli .

When i try with beeline i get an error saying

Error: Could not open client transport with JDBC Uri: jdbc:hive2://host:port/defaultt;transportMode=http;httpPath=cliservice: Could not create http connection to jdbc:hive2://host:port/default;transportMode=http;httpPath=cliservice. HTTP Response code: 401 (state=08S01,code=0)

Can some one please shed some light of what is happening here. How should i solve this. I checked hive server 2 logs but there is nothing related to this.

10 REPLIES 10

avatar
Rising Star

Hi All,

In my case, i have configured my cluster with Kerberos, SSL & set the hive transport mode to http. Could you please let me know how the connection string should look like?

I'm using the below connection string but still getting the same "HTTP Response code: 401 (state=08S01,code=0)" error:

Note: I do have a valid kerberos ticket for accessing the service.

# beeline -u "jdbc:hive2://xxx.xxx.local:10001/;principal=hive/xxx.xxx.local@xxx.LOCAL;ssl=true;sslTrustStore=/opt/hdp/security/pki/certs-new/jks/truststore.jks;trustStorePassword=changeit;transportMode=http;httpPath=cliservice"

Connecting to jdbc:hive2://xxx.xxx.local:10001/;principal=hive/xxx.xxx.local@xxx.LOCAL;ssl=true;sslTrustStore=/opt/hdp/security/pki/certs-new/jks/truststore.jks;trustStorePassword=changeit;transportMode=http;httpPath=cliservice 18/08/30 13:11:33 [main]: ERROR jdbc.HiveConnection: Error opening session org.apache.thrift.transport.TTransportException: HTTP Response code: 401 at org.apache.thrift.transport.THttpClient.flushUsingHttpClient(THttpClient.java:262) at org.apache.thrift.transport.THttpClient.flush(THttpClient.java:313) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:73) at org.apache.thrift.TServiceClient.sendBase(TServiceClient.java:62) at org.apache.hive.service.cli.thrift.TCLIService$Client.send_OpenSession(TCLIService.java:158) at org.apache.hive.service.cli.thrift.TCLIService$Client.OpenSession(TCLIService.java:150) at org.apache.hive.jdbc.HiveConnection.openSession(HiveConnection.java:622) at org.apache.hive.jdbc.HiveConnection.<init>(HiveConnection.java:221) 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:1204) at org.apache.hive.beeline.Commands.connect(Commands.java:1100) 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:54) at org.apache.hive.beeline.BeeLine.dispatch(BeeLine.java:998) at org.apache.hive.beeline.BeeLine.initArgs(BeeLine.java:717) at org.apache.hive.beeline.BeeLine.begin(BeeLine.java:779) at org.apache.hive.beeline.BeeLine.mainWithInputRedirection(BeeLine.java:493) at org.apache.hive.beeline.BeeLine.main(BeeLine.java:476) 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:233) at org.apache.hadoop.util.RunJar.main(RunJar.java:148) Error: Could not establish connection to jdbc:hive2://xxx.xxx.local:10001/;principal=hive/xxx.xxx.local@xxx.LOCAL;ssl=true;sslTrustStore=/opt/hdp/security/pki/certs-new/jks/truststore.jks;trustStorePassword=changeit;transportMode=http;httpPath=cliservice: HTTP Response code: 401 (state=08S01,code=0) Beeline version 1.2.1000.2.6.5.0-292 by Apache Hive 0: jdbc:hive2://xxx.xxx.local:10001/ (closed)>