You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by "Larry McCay (JIRA)" <ji...@apache.org> on 2016/12/03 17:28:58 UTC

[jira] [Created] (KNOX-797) Default Topology Feature Not Working

Larry McCay created KNOX-797:
--------------------------------

             Summary: Default Topology Feature Not Working
                 Key: KNOX-797
                 URL: https://issues.apache.org/jira/browse/KNOX-797
             Project: Apache Knox
          Issue Type: Bug
          Components: Server
            Reporter: Larry McCay
            Assignee: Larry McCay
             Fix For: 0.11.0


From Mohammad Islam:

I set  "default.app.topology.name" in gateway-site.xml  to "uber" (my default topology name).  
It worked fine if I gave the full URL. The command looks like this "curl  http://<KNOX_GW_URL>/gateway/uber/webhdfs/v1/?op=GETHOMEDIRECTORY'".
 
However, when I tried with command "curl  http://<KNOX_GW_URL>/webhdfs/v1/?op=GETHOMEDIRECTORY'". I got the HTTP error code 500. I looked into gateway.log file and found quite a few error related to rewrite. The exact error messages are shown below:

Error message

2016-11-30 00:39:51,565 ERROR hadoop.gateway (UrlRewriteProcessor.java:rewrite(169)) - Failed to rewrite URL: http://<KNOX_GW_URL>/webhdfs/v1/?op=GETHOMEDIRECTORY, direction: IN via rule: WEBHDFS/webhdfs/inbound/namenode/root, status: FAILURE
2016-11-30 00:39:51,565 ERROR hadoop.gateway (UrlRewriteProcessor.java:rewrite(169)) - Failed to rewrite URL: http://<KNOX_GW_URL>/webhdfs/v1/?op=GETHOMEDIRECTORY, direction: IN via rule: WEBHDFS/webhdfs/inbound/namenode/root, status: FAILURE


After that, I modified the webhdfs/2.4.0/rewrite.xml by rewriting the following pattern and it worked for short URL but long URL faces the same issue.

Original: 

{noformat}
<rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/root" pattern="*://*:*/**/webhdfs/{version}/?{**}">
        <rewrite template="{$serviceUrl[WEBHDFS]}/{version}/?{**}"/>
    </rule>
{noformat}

Modified :

{noformat}
    <rule dir="IN" name="WEBHDFS/webhdfs/inbound/namenode/root" pattern="*://*:*/webhdfs/{version}/?{**}">
        <rewrite template="{$serviceUrl[WEBHDFS]}/{version}/?{**}"/>
    </rule>
{noformat}
  

Overall, the rewrite pattern may be the issue. We will need to support for both short and long URL. May be, we can add multiple rewrite rules for each route in service.xml.
Is there any other cleaner way which may work for all cases such as webhdfs, yarn, hive, UIs etc?




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)