<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>question Re: Beeline/jdbc connection issue to Hive SSL via Knox SSL in Support Questions</title>
    <link>https://community.cloudera.com/t5/Support-Questions/Beeline-jdbc-connection-issue-to-Hive-SSL-via-Knox-SSL/m-p/290685#M215025</link>
    <description>&lt;P&gt;Reading my own post gave me an idea how to fix it and that actually worked. So posting the solution just in case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Advance topology configuration for knox&amp;nbsp; ( Ambari -&amp;gt; Knox -&amp;gt; Configs -&amp;gt; Advanced topology )&amp;nbsp;&lt;/P&gt;&lt;P&gt;The service for Hive had to be updated from :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;            &amp;lt;service&amp;gt;
                &amp;lt;role&amp;gt;HIVE&amp;lt;/role&amp;gt;
                &amp;lt;url&amp;gt;http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}&amp;lt;/url&amp;gt;
            &amp;lt;/service&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;To&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;            &amp;lt;service&amp;gt;
                &amp;lt;role&amp;gt;HIVE&amp;lt;/role&amp;gt;
                &amp;lt;url&amp;gt;https://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}&amp;lt;/url&amp;gt;
            &amp;lt;/service&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Fri, 28 Feb 2020 11:55:25 GMT</pubDate>
    <dc:creator>leszek_liberda</dc:creator>
    <dc:date>2020-02-28T11:55:25Z</dc:date>
    <item>
      <title>Beeline/jdbc connection issue to Hive SSL via Knox SSL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-jdbc-connection-issue-to-Hive-SSL-via-Knox-SSL/m-p/290684#M215024</link>
      <description>&lt;P&gt;Hello,&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to connect from beeline/jdbc to ssl enabled Hive (3.1.0) via ssl enabled Knox (&amp;nbsp;&lt;SPAN&gt;1.0.0 ) but without success. &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;1) The same connection works perfectly fine with ssl disabled on Hive side&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;( Ambari -&amp;gt; Hive -&amp;gt; Configs -&amp;gt; Settings -&amp;gt; Use SSL = false ) &lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;beeline -u "jdbc:hive2://knox_gateway:8443/;ssl=true;sslTrustStore=user_keystore.jks;trustStorePassword=password;transportMode=http;httpPath=gateway/default/hive" -n valid_knox_user -p valid_knox_password

SLF4J: Class path contains multiple SLF4J bindings.
SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/hive/lib/log4j-slf4j-impl-2.10.0.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: Found binding in [jar:file:/usr/hdp/3.1.0.0-78/hadoop/lib/slf4j-log4j12-1.7.25.jar!/org/slf4j/impl/StaticLoggerBinder.class]
SLF4J: See &amp;lt;a href="&amp;lt;a href="&lt;A href="http://www.slf4j.org/codes.html#multiple_bindings" target="_blank"&gt;http://www.slf4j.org/codes.html#multiple_bindings&lt;/A&gt;" target="_blank"&amp;gt;&lt;A href="http://www.slf4j.org/codes.html#multiple_bindings&amp;lt;/a" target="_blank"&gt;http://www.slf4j.org/codes.html#multiple_bindings&amp;lt;/a&lt;/A&gt;&amp;gt;" target="_blank"&amp;gt;&amp;lt;a href="&lt;A href="http://www.slf4j.org/codes.html#multiple_bindings&amp;lt;/a" target="_blank"&gt;http://www.slf4j.org/codes.html#multiple_bindings&amp;lt;/a&lt;/A&gt;" target="_blank"&amp;gt;&lt;A href="http://www.slf4j.org/codes.html#multiple_bindings&amp;lt;/a&amp;lt;/a" target="_blank"&gt;http://www.slf4j.org/codes.html#multiple_bindings&amp;lt;/a&amp;lt;/a&lt;/A&gt;&amp;gt;&amp;gt; for an explanation.
SLF4J: Actual binding is of type [org.apache.logging.slf4j.Log4jLoggerFactory]
Connecting to jdbc:hive2://knox_gateway:8443/;ssl=true;sslTrustStore=user_keystore.jks;trustStorePassword=password;transportMode=http;httpPath=gateway/default/hive
Connected to: Apache Hive (version 3.1.0.3.1.0.0-78)
Driver: Hive JDBC (version 3.1.0.3.1.0.0-78)
Transaction isolation: TRANSACTION_REPEATABLE_READ
Beeline version 3.1.0.3.1.0.0-78 by Apache Hive
0: jdbc:hive2://knox_gateway&amp;gt;&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;As soon as the ssl is enabled for Hive&lt;SPAN&gt;( Ambari -&amp;gt; Hive -&amp;gt; Configs -&amp;gt; Settings -&amp;gt; Use SSL = true)&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;beeline throws error:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;20/02/28 11:53:42 [main]: ERROR jdbc.HiveConnection: Error opening session
org.apache.thrift.transport.TTransportException: HTTP Response code: 500&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And knox gateway log indicates:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;2020-02-28 11:33:41,568 WARN  knox.gateway (DefaultDispatch.java:executeOutboundRequest(147)) - Connection exception dispatching request: &amp;lt;a href="http://hive_server:10001/cliservice?doAs=valid_knox_user" target="_blank"&amp;gt;http://hiver_server:10001/cliservice?doAs=valid_knox_user&amp;lt;/a&amp;gt; org.apache.http.client.ClientPr
otocolException
org.apache.http.client.ClientProtocolException
        at org.apache.http.impl.client.InternalHttpClient.doExecute(InternalHttpClient.java:187)
...
        at org.eclipse.jetty.util.thread.QueuedThreadPool$2.run(QueuedThreadPool.java:683)
        at java.lang.Thread.run(Thread.java:748)
Caused by: org.apache.http.ProtocolException: The server failed to respond with a valid HTTP response
        at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:149)
        at org.apache.http.impl.conn.DefaultHttpResponseParser.parseHead(DefaultHttpResponseParser.java:56)
        at org.apache.http.impl.io.AbstractMessageParser.parse(AbstractMessageParser.java:259)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Looks like some configuration is needed to instruct knox to connect to hive over ssl but can't find such.&amp;nbsp;I tried to add Hive ssl certificate to Knox gateway truststore&amp;nbsp; located in /var/lib/knox/data-3.1.0.0-78/security/keystores/gateway.jks but that did not help. Any advice ?&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 14:13:27 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-jdbc-connection-issue-to-Hive-SSL-via-Knox-SSL/m-p/290684#M215024</guid>
      <dc:creator>leszek_liberda</dc:creator>
      <dc:date>2020-02-28T14:13:27Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline/jdbc connection issue to Hive SSL via Knox SSL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-jdbc-connection-issue-to-Hive-SSL-via-Knox-SSL/m-p/290685#M215025</link>
      <description>&lt;P&gt;Reading my own post gave me an idea how to fix it and that actually worked. So posting the solution just in case.&amp;nbsp;&lt;/P&gt;&lt;P&gt;In Advance topology configuration for knox&amp;nbsp; ( Ambari -&amp;gt; Knox -&amp;gt; Configs -&amp;gt; Advanced topology )&amp;nbsp;&lt;/P&gt;&lt;P&gt;The service for Hive had to be updated from :&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;            &amp;lt;service&amp;gt;
                &amp;lt;role&amp;gt;HIVE&amp;lt;/role&amp;gt;
                &amp;lt;url&amp;gt;http://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}&amp;lt;/url&amp;gt;
            &amp;lt;/service&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;To&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;            &amp;lt;service&amp;gt;
                &amp;lt;role&amp;gt;HIVE&amp;lt;/role&amp;gt;
                &amp;lt;url&amp;gt;https://{{hive_server_host}}:{{hive_http_port}}/{{hive_http_path}}&amp;lt;/url&amp;gt;
            &amp;lt;/service&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 11:55:25 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-jdbc-connection-issue-to-Hive-SSL-via-Knox-SSL/m-p/290685#M215025</guid>
      <dc:creator>leszek_liberda</dc:creator>
      <dc:date>2020-02-28T11:55:25Z</dc:date>
    </item>
    <item>
      <title>Re: Beeline/jdbc connection issue to Hive SSL via Knox SSL</title>
      <link>https://community.cloudera.com/t5/Support-Questions/Beeline-jdbc-connection-issue-to-Hive-SSL-via-Knox-SSL/m-p/290691#M215030</link>
      <description>&lt;P&gt;I'm happy to see you resolved your issue. Please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="mark as solution button" style="width: 331px;"&gt;&lt;img src="https://community.cloudera.com/t5/image/serverpage/image-id/5960i4EC112CCAAC11427/image-size/large?v=v2&amp;amp;px=999" role="button" title="Screen Shot 2019-08-06 at 1.54.47 PM.png" alt="Screen Shot 2019-08-06 at 1.54.47 PM.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 28 Feb 2020 14:14:38 GMT</pubDate>
      <guid>https://community.cloudera.com/t5/Support-Questions/Beeline-jdbc-connection-issue-to-Hive-SSL-via-Knox-SSL/m-p/290691#M215030</guid>
      <dc:creator>cjervis</dc:creator>
      <dc:date>2020-02-28T14:14:38Z</dc:date>
    </item>
  </channel>
</rss>

