You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@knox.apache.org by Jeffrey Rodriguez <je...@gmail.com> on 2017/03/29 01:56:50 UTC

KNOX-751 - rewrite function for OUTPUT rewrite to get query parameter.

Hi folks,

     The usage for this solution is to be able to add an obtain an inbound
request query parameter so in the OUTPUT rewrite we can access it. This
allow us to attach the query parameter which may have information we may
want to use on the content of the OUTPUT rewrite.

In Knox, we would create one single service definition with a one url. This
map one-to-one a service definition to one service. Let’s say we want to
use Knox with multiple instances of a service, for example we may have
multiple DataNodes UIs (on port 50075). We could support this case by:

1.    Creating a topology service definition to one of the DataNodes.

2.    From the UI supporting the links to multiple DataNode hosts we could
do:

a.    Link to DataNode1 can be IN rewritten using Knox to the hostname of
DataNode1, and we add the hostname to query parameter.

b.    Link to DataNode2 can be IN rewritten using Knox to the hostname of
DataNode2. And we add the hostname to query parameter.

c.     …….

3.    Then when response is OUT rewritten.

a.    We can attach using the function of this Jira to the query parameter
passed to the URI content (in this case HTML href).

b.    …..

4.    Since we have the parameter on the query (and the links are rewritten
to go through Knox) we can do the same as step 2, and forward to the host
defined in query parameter thus supporting multiple instances.

One advantage of this solution is to we can add a new datanode and we would
be able to proxy to it without modifying the topology.

One improvement for this Jira KNOX-751  would be to encrypt the value of
the query parameter we are passing. I may explore opening this additional
Jira.



The places where I found the need of this two function are: In the HDFS UI
links to DataNodes, and the links of the Yarn RM UI to their local logs. (
I will upload these into additional Jiras to update the service definitions
for URI that we previously contributed).


Thank you very much for your feedback.


Jeffrey E Rodriguez Viana