You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Kevin Minder (JIRA)" <ji...@apache.org> on 2013/06/07 22:48:20 UTC

[jira] [Commented] (KNOX-9) Support Hive via JDBC+ODBC/Thrift/HTTP

    [ https://issues.apache.org/jira/browse/KNOX-9?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13678416#comment-13678416 ] 

Kevin Minder commented on KNOX-9:
---------------------------------

Here is the steps (and some issues) to make Hive JDBC working with Knox.
1. Hive Server side:
    a) Start Hive Server with "hive.server2.servermode=http" pair;
2. Knox side:
    a) Add to deployment file following tag:
        <service>
           <role>HIVE</role>
           <url>http://{hive-server-host}:{hive-server-port}</url>
        </service>
     by default hive-server-port=10000
3. Client side (JDBC):
    a) Hive JDBC in HTTP mode depends on following libraries to run successfully(must be in the classpath):
        - generated hive thrift artifacts, httpcore, httpclient, hive-common, hadoop-core, commons-logging, hive-cli, commons-codec, hive-service;
    b) import gateway certificate into local keystore:
        keytool -import -alias hadoop.gateway -file hadoop.gateway.cer -keystore hdp.gtw
    c) because gateway certificate's CN='hadoop.gateway', hosts file has to contain 'hadoop.gateway' alias which points to hadoop gateway host;
    d) client has to be run with following VM Options:
         -Djavax.net.ssl.keyStoreType=pkcs12 -Djavax.net.ssl.trustStoreType=jks -Djavax.net.ssl.keyStore={path.to.keystore.with.hadoop.gateway.cer} -Djavax.net.ssl.trustStore={path.to.keystore.with.hadoop.gateway.cer} -Djavax.net.ssl.keyStorePassword={keystore.pass} -Djavax.net.ssl.trustStorePassword={keystore.pass};
    e) connection URL has to be following:
         jdbc:hive2://hadoop.gateway:{gateway-port}/?hive.server2.servermode=https;hive.server2.http.path={gateway-path}/{cluster-name}/hive
    issue: 'hadoop.gateway' host value can't be changed because we will get "javax.net.ssl.SSLException: hostname in certificate didn't match: <192.168.56.101> != <hadoop.gateway>" ('hadoop.gateway' alias was added to hosts but it still didn't work)
    f) look at https://cwiki.apache.org/confluence/display/Hive/GettingStarted#GettingStarted-DDLOperations for examples;
       hint: it would be better to execute "set hive.security.authorization.enabled=false" as the first statement - for testing purposes;
   http://gettingstarted.hadooponazure.com/hw/hive.html - here is a good example of Hive DDL/DML operations.
                
> Support Hive via JDBC+ODBC/Thrift/HTTP
> --------------------------------------
>
>                 Key: KNOX-9
>                 URL: https://issues.apache.org/jira/browse/KNOX-9
>             Project: Apache Knox
>          Issue Type: Improvement
>          Components: Server
>            Reporter: Kevin Minder
>         Attachments: KNOX-9.patch
>
>
> The goal of this improvement is to allow Hive JDBC/ODBC access to pass through the gateway just like REST API calls.  In order to do this the JDBC/ODBC drivers will need to changed or configured to use HTTP as their underlying protocol.  I believe they both use Thrift as a marshaling mechanism and that does support HTTP transport.
> Hive JDBC driver code is here
> https://github.com/hortonworks/hive/tree/bigwheel-alpha2-0.10.0/jdbc/src/java/org/apache/hive/jdbc 
> Support for jdbc over http (by switching thrift to use http transport) are in the hive-monarch repo

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira