[
https://issues.apache.org/jira/browse/KNOX-1744?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16777252#comment-16777252
]
Akshay Nikam edited comment on KNOX-1744 at 2/25/19 8:08 PM:
-------------------------------------------------------------
The changes that worked for me are as follows:
services/sparkhistoryui/2.3.0/rewrite.xml
</content>
</filter>
+ <!-- re-write rule for yarn container logs -->
+ <rule dir="OUT"
name="SPARKHISTORYUI/sparkhistory/outbound/node/containerlogs"
pattern="*://*:*/node/containerlogs/\{**}?\{**}">
+ <match pattern="\{scheme}://\{host}:\{port}/node/containerlogs/\{**}?\{**}"/>
+ <rewrite
template="\{$frontend[url]}/yarn/nodemanager/node/containerlogs/\{**}?\{**}?\{scheme}?\{host}?\{port}"/>
+ </rule>
+
+ <filter name="SPARKHISTORYUI/sparkhistory/outbound/body">
+ <content type="*/html">
+ <apply path="/sparkhistory/history"
rule="SPARKHISTORYUI/sparkhistory/outbound/node/containerlogs"/>
+ </content>
+ </filter>
+
<!-- re-write rule for location when SHS redirects to Knox SSO login page -->
<rule dir="OUT"
name="SPARKHISTORYUI/sparkhistory/outbound/headers/location/sso">
<match
pattern="\{scheme}://\{host}:\{port}/\{gateway}/\{knoxsso}/\{api}/\{v}/websso?originalUrl=\{**}"/>
services/sparkhistoryui/2.3.0/service.xml
---
a/projects/security/containers/mssql-security-knox/overlay/knox/data/services/sparkhistoryui/2.3.0/service.xml
+++
b/projects/security/containers/mssql-security-knox/overlay/knox/data/services/sparkhistoryui/2.3.0/service.xml
@@ -35,6 +35,7 @@
<route path="/sparkhistory/history/**/jobs/**?**">
<rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/headers/jobs"
to="response.headers"/>
<rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/rqheaders"
to="request.headers"/>
+ <rewrite apply="SPARKHISTORYUI/sparkhistory/outbound/body"
to="response.body"/>
</route>
</routes>
</service>
was (Author: anikam):
The changes that worked for me are as follows:
> [Spark History UI Service] Executor logs (stdout/stderr) links are broken
> --------------------------------------------------------------------------
>
> Key: KNOX-1744
> URL: https://issues.apache.org/jira/browse/KNOX-1744
> Project: Apache Knox
> Issue Type: Bug
> Affects Versions: 1.2.0
> Reporter: Nicolas Colomer
> Priority: Minor
> Fix For: 1.3.0
>
> Attachments: image-2019-01-22-13-04-53-935.png,
> image-2019-01-22-13-11-55-412.png
>
>
> The executor logs (stdout/stderr) links from the Yarn UI Service all directly
> points to the slaves nodes.
> !image-2019-01-22-13-11-55-412.png!
> Eg. the link:
> {noformat}
> http://emr-slave-hostname:8042/node/containerlogs/container_1547901130703_0034_01_000001/hadoop/stdout?start=-4096{noformat}
> Should have been instead:
> {noformat}
> https://knox/gateway/cluster/yarn/nodemanager/node/containerlogs/container_1547901130703_0034_01_000001/hadoop?scheme=http&host=emr-slave-hostname&port=8042{noformat}
> And finally respect pattern:
> {noformat}
> https://knox/gateway/emr/yarn/nodemanager/node/containerlogs/{your container
> id}/hadoop?scheme=http&host={executor host}&port=8042 {noformat}
> I guess adding some voodoo in the Knox yarnui's
> [rewrite.xml|https://github.com/apache/knox/blob/master/gateway-service-definitions/src/main/resources/services/yarnui/2.7.0/rewrite.xml]
> file might be enough to fix this.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)