Support Questions
Find answers, ask questions, and share your expertise
Announcements
Alert: Welcome to the Unified Cloudera Community. Former HCC members be sure to read and learn how to activate your account here.

KNOX with Spark 2.x History UI not working (works with Spark 1.6)

Highlighted

KNOX with Spark 2.x History UI not working (works with Spark 1.6)

New Contributor

In our HDP 2.5. env we have Spark 1.6 (default which ships with HDP 2.5) and in parallel a separate Spark 2.0 and/or Spark 2.1 instance running…. All fine so far.

  • We can directly access the Spark History UI of 1.6, 2.0 and 2.1 without any problems
  • Via KNOX (Version 0.9.0 which ships with HDP 2.5 per default) we can also access the Spark History UI which comes with Spark 1.6 also without problems (we can see spark apps)

sparkhistoryui-16.gif

but

  • If we point KNOX to the History Server from Spark 2.0 or 2.1 it still displays the Spark History UI but we can not see any completed or "in-completed" Spark applications anymore. I think KNOX somehow mess up during the "rewrite" and forwarding of the Spark 2.x UI via KNOX to me but I have no evidence, can't see an error in KNOX or Spark History Server UI etc.

sparkhistoryui-knox-spark2.gif

I even compared the "rewrite" definition from KNOX for SPARK in /usr/hdp/current/knox-server/data/services/sparkhistoryui/1.4.0 With the latest definition from knox.apache.org Version 0.11. but all the same….

Any idea? I have the feeling KNOX coded something for Spark 1.6 but it simply does not work for Spark 2.x but I also did not find any ToDo or similar in KNOX Jira to check or fix this.

Any thoughts or help would be appreciated!

12 REPLIES 12

Re: KNOX with Spark 2.x History UI not working (works with Spark 1.6)

New Contributor

I'm hitting the same problem as well. If you look at the browser console, you would notice that we're getting a 404 Not Found for all the JS and CSS files on the page. Funnily enough, if you directly put in the path to the CSS/JS file, viz

https://host:8443/gateway/sandbox/sparkhistory/static/bootstrap.min.css

it loads fine. However when accessed on the history server page it's not found.

Re: KNOX with Spark 2.x History UI not working (works with Spark 1.6)

Rising Star

Sorry for the late answer, can you try and add

export SPARK_HISTORY_OPTS="-Dspark.ui.proxyBase=/gateway/default/sparkhistory"

to the spark-env?

This should solve the issue. Thanks.

Re: KNOX with Spark 2.x History UI not working (works with Spark 1.6)

New Contributor

I faced the same issue in my envt and a blank page loads with static elements(shown below) .. but not the table which shows the jobs. It was working till version 2.1.1.x

Also .. when I use the GET API I can see the details . Can you pls help @Marco Gaido

2.3.0.2.6.5.0-292 History Server
  • Event log directory: hdfs:///spark2-history/

Last updated: 2018-07-20 02:53:06

Client local time zone: Asia/Kolkata

Show incomplete applications
,

Hi I tried adding the same to my environment and its still not working for us.The table come as blank with logo and static texts but at the same time GET API can retrieve the jobs.Can you pls help @Marco Gaido

Re: KNOX with Spark 2.x History UI not working (works with Spark 1.6)

Rising Star

Hi @lawang mishra! Unfortunately I cannot see the picture. I get redirected to your env which I cannot access as I don't have credentials of course.

Can you please check using your browser which API is called (ie. SHS uses a REST call for retrieving the application list, can you please report here the URL which is tried to access)? Moreover, can you please check in the source code of the HTML main page which is the value passed as argument of setUIRoot?

Re: KNOX with Spark 2.x History UI not working (works with Spark 1.6)

New Contributor

Hi @Marco Gaido, I saw that the application related calls are going via the historymain.js but the historypage-template.html related request is a wrongly formed gatewayurl (missing the knox ur probably the bad uiRoot l) and hence fails . Need to still investigate on the pointer given by you. I will share the details after checking tomorrow.But I think this is a js issue rather then the rewrite rule issue.

Re: KNOX with Spark 2.x History UI not working (works with Spark 1.6)

New Contributor

@Marco Gaido , In the main page setUIRoot('') is blank probably thats the cause that its not getting set later too and not showing anything.Is it a known issue and we have a fix for this?

Re: KNOX with Spark 2.x History UI not working (works with Spark 1.6)

Rising Star

@lawang mishra if you set:

export SPARK_HISTORY_OPTS="-Dspark.ui.proxyBase=/gateway/default/sparkhistory"

you should see "/gateway/default/sparkhistory" in setUIRoot. If that doesn't happen, probably there is something wrong in your configuration. you can check it by executing spark-env.sh and then check the content of SPARK_HISTORY_OPTS.

Re: KNOX with Spark 2.x History UI not working (works with Spark 1.6)

New Contributor

@Marco Gaido, After setting this as environment variable as a part of my spark-env.sh it's working fine for me now.

Earlier I was setting this as a property in key/value pair and it was failing for me.Thanks for your help .Much Appreciated!!

In the main html source now I can see this setUIRoot('/gateway/default/sparkhistory')

Re: KNOX with Spark 2.x History UI not working (works with Spark 1.6)

New Contributor

@marco gaido, would you mind explaining the reason behind this.. as the same code without setting this variable explicitly was working earlier in version 2.1?

Don't have an account?
Coming from Hortonworks? Activate your account here