Hi, I'm having issues when trying to connect to Hive through Knox using
beeline.
My current infrastructure is a Hadoop cluster, and a separate instance
running Knox.

With the following beeline connection I'm able to use Hive from beeline,
without Knox:

!connect
jdbc:hive2://<hive-host>:10001/default;auth=noSasl;transportMode=http;httpPath=cliservice
<user> org.apache.hive.jdbc.HiveDriver

This means that Hiveserver2 is using http transport mode, using
cliservice endpoint and port 10001 is working.

I replicate that on Knox, following these instructions:
https://knox.apache.org/books/knox-1-1-0/user-guide.html#Hive

And created a topology named "test" that just contains:

  <gateway>
    <provider>
      <role>authentication</role>
      <name>ShiroProvider</name>
      <enabled>true</enabled>
      <param name="users.admin" value="admin-secret"/>
      <param name="urls./**" value="authcBasic"/>
    </provider>

  </gateway>

  <service>
      <role>HIVE</role>
      <url>http://<hive-host>:10001/cliservice</url>
      <param>
          <name>replayBufferSize</name>
          <value>8</value>
      </param>
  </service>


But I'm not able to connect running the following:

!connect
jdbc:hive2://<knox-host>:<knox-port>/default;auth=noSasl;ssl=false;transportMode=http;httpPath=gateway/test/hive
admin admin-secret org.apache.hive.jdbc.HiveDriver

I get the following error:

19/04/03 03:39:48 [main]: WARN jdbc.HiveConnection: Failed to connect to
<knox-host>:<knox-port>
Error: Could not open client transport with JDBC Uri:
jdbc:hive2://<knox-host>:<knox-port>default;auth=noSasl;ssl=false;transportMode=http;httpPath=gateway/test/hive:
Could not establish connection to
jdbc:hive2://<knox-host>:<knox-port>/default;auth=noSasl;ssl=false;transportMode=http;httpPath=gateway/test/hive:
org.apache.http.client.ClientProtocolException (state=08S01,code=0)

Any idea? Am I missing something?

Thanks.

Reply via email to