YARN-6275. Fail to show real-time tracking charts in SLS (yufeigu via rkanter)

This commit is contained in:
Robert Kanter 2017-03-07 13:47:52 -08:00
parent 38d75dfd3a
commit 1598fd3b79
2 changed files with 8 additions and 2 deletions

View File

@ -103,12 +103,16 @@ function run_simulation() {
hadoop_java_exec sls org.apache.hadoop.yarn.sls.SLSRunner ${args}
}
this="${BASH_SOURCE-$0}"
bin=$(cd -P -- "$(dirname -- "${this}")" >/dev/null && pwd -P)
# copy 'html' directory to current directory to make sure web sever can access
cp -r "${bin}/../html" "$(pwd)"
# let's locate libexec...
if [[ -n "${HADOOP_HOME}" ]]; then
HADOOP_DEFAULT_LIBEXEC_DIR="${HADOOP_HOME}/libexec"
else
this="${BASH_SOURCE-$0}"
bin=$(cd -P -- "$(dirname -- "${this}")" >/dev/null && pwd -P)
HADOOP_DEFAULT_LIBEXEC_DIR="${bin}/../../../../../libexec"
fi

View File

@ -39,6 +39,7 @@ import org.apache.hadoop.yarn.sls.SLSRunner;
import org.apache.hadoop.yarn.sls.scheduler.FairSchedulerMetrics;
import org.apache.hadoop.yarn.sls.scheduler.SchedulerMetrics;
import org.apache.hadoop.yarn.sls.scheduler.SchedulerWrapper;
import org.eclipse.jetty.http.MimeTypes;
import org.eclipse.jetty.server.Handler;
import org.eclipse.jetty.server.Request;
import org.eclipse.jetty.server.Server;
@ -118,6 +119,7 @@ public class SLSWebApp extends HttpServlet {
public void start() throws Exception {
// static files
final ResourceHandler staticHandler = new ResourceHandler();
staticHandler.setMimeTypes(new MimeTypes());
staticHandler.setResourceBase("html");
Handler handler = new AbstractHandler() {