[
https://issues.apache.org/jira/browse/KNOX-1032?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16190905#comment-16190905
]
Pierre Beauvois commented on KNOX-1032:
---------------------------------------
Hi [~lmccay] - I did a first version. The main features are ok but a few
optimizations are required in order to be perfect (logs redirection or
nodemanagers access).
Topology:
{code:html}
<service>
<role>APPLICATIONHISTORYUI</role> <!-- applicationhistory -->
<url>http://mapr-ha-node-01.bigdata.kvm:8188</url>
</service>
{code}
applicationhistoryui service.xml
{code:html}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<service role="APPLICATIONHISTORYUI" name="applicationhistory" version="2.7.0">
<routes>
<route path="/applicationhistory/proxy/**">
<rewrite
apply="APPLICATIONHISTORYUI/applicationhistory/outbound/headers/jobhistory/job"
to="response.headers"/>
<rewrite
apply="APPLICATIONHISTORYUI/applicationhistory/outbound/apps1"
to="response.body"/>
</route>
<route path="/applicationhistory/">
<rewrite
apply="APPLICATIONHISTORYUI/applicationhistory/outbound/apps"
to="response.body"/>
<rewrite
apply="APPLICATIONHISTORYUI/applicationhistory/outbound/headers/jobhistory/job"
to="response.headers"/>
</route>
<route path="/applicationhistory/**">
<rewrite
apply="APPLICATIONHISTORYUI/applicationhistory/outbound/apps"
to="response.body"/>
<rewrite
apply="APPLICATIONHISTORYUI/applicationhistory/outbound/headers/jobhistory/job"
to="response.headers"/>
</route>
</routes>
</service>
{code}
applicationhistoryui rewrite.xml:
{code:html}
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<rules>
<rule dir="IN" name="APPLICATIONHISTORYUI/applicationhistory/inbound/root"
pattern="*://*:*/**/applicationhistory/">
<rewrite template="{$serviceUrl[APPLICATIONHISTORYUI]}/applicationhistory"/>
</rule>
<rule dir="IN" name="APPLICATIONHISTORYUI/applicationhistory/inbound/path"
pattern="*://*:*/**/applicationhistory/{**}">
<rewrite
template="{$serviceUrl[APPLICATIONHISTORYUI]}/applicationhistory/{**}"/>
</rule>
<rule dir="IN" name="APPLICATIONHISTORYUI/applicationhistory/inbound/proxy"
pattern="*://*:*/**/applicationhistory/proxy/{**}">
<!--<rewrite template="{$serviceUrl[APPLICATIONHISTORYUI]}/proxy/{**}"/>-->
<rewrite template="{$serviceUrl[YARNUI]}/proxy/{**}"/>
</rule>
<rule dir="IN" name="APPLICATIONHISTORYUI/applicationhistory/inbound/static"
pattern="*://*:*/**/applicationhistory/static/{**}">
<rewrite template="{$serviceUrl[APPLICATIONHISTORYUI]}/static/{**}"/>
</rule>
<rule dir="IN" name="APPLICATIONHISTORYUI/applicationhistory/inbound/logs"
pattern="*://*:*/**/applicationhistory/logs">
<rewrite template="{$serviceUrl[APPLICATIONHISTORYUI]}/logs"/>
</rule>
<rule dir="IN"
name="APPLICATIONHISTORYUI/applicationhistory/inbound/logs/files"
pattern="*://*:*/**/applicationhistory/logs/{**}">
<rewrite template="{$serviceUrl[APPLICATIONHISTORYUI]}/logs/{**}"/>
</rule>
<rule dir="IN" name="APPLICATIONHISTORYUI/yarn/inbound/node"
pattern="*://*:*/**/applicationhistory/node/{**}">
<rewrite
template="{$serviceUrl[APPLICATIONHISTORYUI]}/applicationhistory/node/{**}"/>
</rule>
<rule dir="IN"
name="APPLICATIONHISTORYUI/applicationhistory/inbound/node/query"
pattern="*://*:*/**/applicationhistory/node/{**}?{**}">
<rewrite
template="{$serviceUrl[APPLICATIONHISTORYUI]}/applicationhistory/node/{**}?{**}"/>
</rule>
<rule dir="IN"
name="APPLICATIONHISTORYUI/applicationhistory/inbound/jobhistory/job"
pattern="*://*:*/**/applicationhistory/jobhistory/job/{**}?{scheme}?{host}?{port}">
<rewrite template="{scheme}://{host}:{port}/jobhistory/job/{**}"/>
</rule>
<rule dir="IN" name="APPLICATIONHISTORYUI/yarn/inbound/jobhistory/params"
pattern="*://*:*/**/jobstory/jobhistory/{**}?{**}">
<rewrite template="{$serviceUrl[JOBSTORYUI]}/jobhistory/{**}?{**}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/inbound/jobhistory/logs"
pattern="*1; url=*://*:*/jobhistory/logs/{**}">
<rewrite template="1;
url=/gateway/jobstoryui/jobstory/jobhistory/logs/{**}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/headers/logs/location">
<match pattern="{scheme}://{host}:{port}/logs/?{**}"/>
<rewrite
template="{$frontend[url]}/applicationhistory/logs?{scheme}?host={$hostmap(host)}?{port}?{**}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/logs/files"
pattern="/logs/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/logs/{**}"/>
</rule>
<rule dir="OUT" name="APPLICATIONHISTORYUI/applicationhistory/outbound/static"
pattern="/static/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/static/{**}"/>
</rule>
<rule dir="OUT" name="APPLICATIONHISTORYUI/applicationhistory/outbound/apps"
pattern="/applicationhistory/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/{**}"/>
</rule>
<rule dir="OUT" name="APPLICATIONHISTORYUI/applicationhistory/outbound/node"
pattern="/node/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/node/{**}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/applicationhistory/apps"
pattern="*://*:*/applicationhistory/app/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/app/{**}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/applicationhistory/apps/app1">
<rewrite template="{$frontend[url]}/applicationhistory/apps"/>
</rule>
<rule dir="OUT" name="APPLICATIONHISTORYUI/applicationhistory/outbound/proxy"
pattern="*://*:*/proxy/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/proxy/{**}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/jobhistory/params"
pattern="/jobhistory/{**}?{**}">
<rewrite template="/gateway/jobstoryui/jobstory/jobhistory/{**}?{**}"/>
</rule>
<rule flow="OR" dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/headers/jobhistory/job/location">
<match pattern="{scheme}://{host}:{port}/jobhistory/job/{**}">
<rewrite
template="{$frontend[url]}/applicationhistory/jobhistory/job/{**}?{scheme}?{host}?{port}"/>
</match>
<match pattern="*://*:*/history/{**}?{**}">
<rewrite template="{$frontend[url]}/sparkhistory/{**}?{**}"/> <!--
updated to prevent from redirection errors -->
</match>
<match pattern="*://*:*/?{**}/tez-app/{**}">
<rewrite template="{frontend[url]}/tez/?{**}/{**}"/>
</match>
<match pattern="*://*:*/applicationhistory/app/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/app/{**}"/>
</match>
<!--<match pattern="*://*:*/applicationhistory/apps/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/apps/{**}"/>
</match>-->
<match pattern="*://*:*/applicationhistory/apps">
<rewrite template="{$frontend[url]}/applicationhistory/apps"/>
</match>
<match pattern="*://*:*/applicationhistory">
<rewrite template="{$frontend[url]}/applicationhistory"/>
</match>
</rule>
<filter name="APPLICATIONHISTORYUI/applicationhistory/outbound/headers/logs">
<content type="application/x-http-headers">
<apply path="Location"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/headers/logs/location"/>
</content>
</filter>
<filter
name="APPLICATIONHISTORYUI/applicationhistory/outbound/headers/jobhistory/job">
<content type="application/x-http-headers">
<apply path="Location"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/headers/jobhistory/job/location"/>
</content>
</filter>
<filter name="APPLICATIONHISTORYUI/applicationhistory/outbound/apps">
<content type="*/html">
<apply path="(https?://[^/':,]+:[\d]+)?/proxy/[^']*"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/apps/history"/>
<apply
path="(https?:)?//[^/':,]+:[\d]+/node/containerlogs/container(_[^/':,]+)+/[^/':,]+"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/node/containerlogs"/>
<apply path="(https?://[^/':,]+:[\d]+)?/applicationhistory/app"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/applicationhistory/apps/app"/>
<apply path="/applicationhistory/container"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/container"/>
</content>
</filter>
<filter name="APPLICATIONHISTORYUI/applicationhistory/outbound/apps1">
<content type="*/html">
<apply path="/proxy/[^']*"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/apps/history1"/>
<apply
path="(https?:)?//[^/':,]+:[\d]+/node/containerlogs/container(_[^/':,]+)+/[^/':,]+"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/node/containerlogs"/>
</content>
</filter>
<filter name="APPLICATIONHISTORYUI/applicationhistory/outbound/filter/apps">
<content type="*/html">
<apply
path="(https?://[^/':,]+:[\d]+)?/applicationhistory/app/application"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/app/application"/>
<apply path="(https?://[^/':,]+:[\d]+)?/proxy/[^']*"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/apps/history"/>
<apply path="/applicationhistory/appatt"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/apps/appatt"/>
<apply
path="(https?:)?//[^/':,]+:[\d]+/node/containerlogs/container(_[^/':,]+)+/[^/':,]+"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/node/containerlogs"/>
<apply path="/applicationhistory/container"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/container"/>
<apply path="https?://[^/':,]+:[\d][^']*"
rule="APPLICATIONHISTORYUI/yarn/outbound/node2"/>
</content>
</filter>
<filter name="APPLICATIONHISTORYUI/applicationhistory/outbound/filter/nodes">
<content type="*/html">
<apply path="(?!http:)//[^/':,]+:[\d]+"
rule="APPLICATIONHISTORYUI/applicationhistory/outbound/node3"/>
</content>
</filter>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/applicationhistory/apps/app">
<rewrite template="{$frontend[url]}/applicationhistory/app"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/apps/appatt">
<rewrite template="{$frontend[url]}/applicationhistory/appatt"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/app/application">
<rewrite template="{$frontend[url]}/applicationhistory/app/application"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/apps/history">
<match pattern="*://*:*/proxy/{**}"/>
<rewrite template="{$frontend[url]}/applicationhistory/proxy/{**}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/apps/history1">
<match pattern="/proxy/{**}"/>
<rewrite template="{$frontend[url]}/applicationhistory/proxy/{**}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/container">
<rewrite template="{$frontend[url]}/applicationhistory/container"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/node/containerlogs">
<match pattern="{scheme}://{host}:{port}/node/containerlogs/{**}"/>
<rewrite
template="{gateway.scheme}://{gateway.host}:{gateway.port}/gateway/nodemanagerui/node/containerlogs/{**}?{scheme}?host={$hostmap(host)}?{port}"/>
</rule>
<rule dir="OUT" name="APPLICATIONHISTORYUI/applicationhistory/outbound/node2">
<match pattern="{scheme}://{host}:{port}"/>
<rewrite
template="{gateway.scheme}://{gateway.host}:{gateway.port}/gateway/nodemanagerui/node?host={host}?port={port}"/>
</rule>
<rule dir="OUT" name="APPLICATIONHISTORYUI/applicationhistory/outbound/node3">
<match pattern="//{host}:{port}"/>
<rewrite
template="{gateway.scheme}://{gateway.host}:{gateway.port}/gateway/nodemanagerui/node?host={host}?port={port}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/node/containerlogs2">
<match pattern="{scheme}://{host}:{port}/node/containerlogs/{**}?{**}"/>
</rule>
<rule dir="OUT" name="APPLICATIONHISTORYUI/applicationhistory/outbound/proxy1"
pattern="/proxy/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/proxy/{**}"/>
</rule>
<rule dir="OUT"
name="APPLICATIONHISTORYUI/applicationhistory/outbound/nodelink"
pattern="{scheme}://{host}:{port}">
<rewrite
template="{gateway.scheme}://{gateway.host}:{gateway.port}/gateway/nodemanagerui/node?{host}"/>
</rule>
<rule dir="OUT" name="APPLICATIONHISTORYUI/applicationhistory/outbound/apps1"
pattern="*://*:*/cluster/{**}">
<rewrite template="{$frontend[url]}/applicationhistory/{**}"/>
</rule>
</rules>
{code}
Sorry to put the code here, I don't know how to provide a patch.
> Apache Hadoop Timeline Server UI support
> ----------------------------------------
>
> Key: KNOX-1032
> URL: https://issues.apache.org/jira/browse/KNOX-1032
> Project: Apache Knox
> Issue Type: New Feature
> Components: Server
> Affects Versions: 0.13.0
> Environment: Apache Hadoop clusters, HortonWorks clusters, Cloudera
> clusters, MapR clusters
> Reporter: Pierre Beauvois
> Fix For: 0.14.0
>
>
> Timeline Server web UI as documented here: [Timeline Server
> UI|https://hadoop.apache.org/docs/stable/hadoop-yarn/hadoop-yarn-site/TimelineServer.html]
> The TLS UI access the generic historic information of applications. This
> addition should be a good value for Knox in the future.
> This feature allow to access the Timeline Server UI through Knox. It could be
> enabled in your topology by adding the following sample:
> {code:java}
> <service>
> <role>TIMELINESERVERUI</role>
>
> <url>http://{timelineserver-host}:{timelineserver-port}/applicationhistory</url>
> </service>
> {code}
--
This message was sent by Atlassian JIRA
(v6.4.14#64029)