Community Articles

Find and share helpful community-sourced technical articles.
Announcements
Celebrating as our community reaches 100,000 members! Thank you!
Labels (2)
avatar

Short Description:

How to configure KNOX for Hive1 and Hive2(LLAP) in parallel.

Article

By default KNOX is configured for Hive1, this article will help you to configure KNOX for Hive2(LLAP).

Step 1. Before configuring KNOX for Hive2, you have to configure Hive2 for http mode as,

Go to Ambari-> Services -> Hive -> configs -> custom hive-interactive-site.xml -> add below properties,

hive.server2.thrift.http.path=cliservice
hive.server2.transport.mode=http

Restart Hive service.

Step 2. Now configure KNOX for Hive2(LLAP) as,

1) Go to the below location in your KNOX server machine:-

# cd /usr/hdp/<HDP VERSION>/knox/data/services

2) Copy the hive directory present in the location and rename it as llap

# cp -rp hive llap

3) Edit the services.xml and rewrite.xml as below:-

# cd llap/0.13.0/
# vim service.xml
------------
<service role="LLAP" name="llap" version="0.13.0">
    <routes>
        <route path="/llap"/>
    </routes>
    <dispatch classname="org.apache.hadoop.gateway.hive.HiveDispatch" ha-classname="org.apache.hadoop.gateway.hive.HiveHaDispatch"/>
</service>

# vim rewrite.xml
------------
<rules>
    <rule dir="IN" name="LLAP/llap/inbound" pattern="*://*:*/**/llap">
        <rewrite template="{$serviceUrl[LLAP]}"/>
    </rule>
</rules>

4) Go to Ambari -> KNOX -> configs -> Edit the Advanced topology of your KNOX service and add LLAP service as,

<service>
	<role>LLAP</role>
	<url>http://<LLAP server hostname>:<HTTP PORT NUMBER>/{{hive_http_path}}</url>
</service>

Example:

<url>http://abcd.example.com:10501/cliservice</url>

5) Restart Knox service.

5,057 Views
Comments
avatar
Rising Star

@nshelke Thanks worked fine. Tried to configure it in HA mode analogously to the HIVE service, but it didn't work out. Did you try it in HA mode as well?

Version history
Last update:
‎12-01-2017 09:44 PM
Updated by:
Contributors