Member since
11-02-2021
2
Posts
0
Kudos Received
0
Solutions
11-02-2021
09:52 PM
Hi community,
We're having a few issues connecting to hive through knox and would really appreciate some assistance if someone can spare a minute or two.
The Environment
HDP (3.1.5)
Apache Hive (version 3.1.0.3.1.5.0-152) Driver: Hive JDBC (version 3.1.0.3.1.5.0-152)
Knox with Ranger - all required hive/hdfs permissions granted to the issuing proxy user
Kerberos enbabled on the cluster
jdbc connection URL through hiveServer2
jdbc:hive2://myKnoxHostname:myKnoxPort/;httpPath=gateway/default/hive;ssl=true;transportMode=http;trustStorePassword=myTrustPass;sslTrustStore=/myTrustLocation/truststore.jks
From the knox logs we can see we successfully authenticate through the proxy and are redirected to the hive thrift endpoint
21/11/02 17:06:13 ||ccfee6d8-ce60-4ba4-b896-4a54b4a06861|audit|172.30.0.2|HIVE||||access|uri|/gateway/default/hive|unavailable|Request method: POST 21/11/02 17:06:14 ||ccfee6d8-ce60-4ba4-b896-4a54b4a06861|audit|172.30.0.2|HIVE|myUser|||authentication|uri|/gateway/default/hive|success| 21/11/02 17:06:14 ||ccfee6d8-ce60-4ba4-b896-4a54b4a06861|audit|172.30.0.2|HIVE|myUser|||authentication|uri|/gateway/default/hive|success|Groups: [hadoop] 21/11/02 17:06:14 ||ccfee6d8-ce60-4ba4-b896-4a54b4a06861|audit|172.30.0.2|HIVE|myUser|||dispatch|uri|https://hiveMasterHost:10000?doAs=myUser| unavailable|Request method: POST 21/11/02 17:06:14 ||ccfee6d8-ce60-4ba4-b896-4a54b4a06861|audit|172.30.0.2|HIVE|myUser|||dispatch|uri|https://hiveMasterHost:10000?doAs=myUser| success|Response status: 405
As you can see after the forward we receive a 405 method not supported response from the jetteyserver. This is confirmed when we hit the hive thrift endpoint using curl
curl -i -u : "https://hiveMasterHost:10000" --negotiate -X POST -v
* Rebuilt URL to: https://hiveMasterHost:10000/
* Hostname was NOT found in DNS cache
* Trying hiveMasterHostIP...
* Connected to hiveMasterHost (hiveMasterHostIP) port 10000 (#0)
> POST / HTTP/1.1
> User-Agent: curl/7.37.0
> Host: hiveMasterHost:10000
> Accept: */*
>
< HTTP/1.1 405 HTTP method POST is not supported by this URL
HTTP/1.1 405 HTTP method POST is not supported by this URL
< Date: Wed, 03 Nov 2021 03:55:21 GMT
Date: Wed, 03 Nov 2021 03:55:21 GMT
< Cache-Control: must-revalidate,no-cache,no-store
Cache-Control: must-revalidate,no-cache,no-store
< Content-Type: text/html;charset=iso-8859-1
Content-Type: text/html;charset=iso-8859-1
< Content-Length: 353
Content-Length: 353
* Server Jetty(9.3.25.v20180904) is not blacklisted
< Server: Jetty(9.3.25.v20180904)
Server: Jetty(9.3.25.v20180904)
<
<html>
<head>
<meta http-equiv="Content-Type" content="text/html;charset=ISO-8859-1"/>
<title>Error 405 </title>
</head>
<body>
<h2>HTTP ERROR: 405</h2>
<p>Problem accessing /. Reason:
<pre> HTTP method POST is not supported by this URL</pre></p>
<hr /><a href="http://eclipse.org/jetty">Powered by Jetty:// 9.3.25.v20180904</a><hr/>
</body>
</html>
* Connection #0 to host hiveMasterHost left intact
Our Ambari settings align with those recommended by Cloudera:
hive.server2.thrift.http.port=10000
hive.server2.transport.mode=http
I've read quite a few posts on Hive through knox but not regarding a 405 via the thrift endpoint. Has anyone else experienced similar issues when trying to connect or have any ideas on what the cause could be we're running a little short on ideas?
Thanks for your time,
D
... View more
Labels: