MAPREDUCE-3021. Change base urls for RM web-ui. Contributed by Thomas Graves.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1176681 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
201b7879ba
commit
5f6adcf396
@ -1457,6 +1457,9 @@ Release 0.23.0 - Unreleased
|
|||||||
|
|
||||||
MAPREDUCE-3054. Unable to kill submitted jobs. (mahadev)
|
MAPREDUCE-3054. Unable to kill submitted jobs. (mahadev)
|
||||||
|
|
||||||
|
MAPREDUCE-3021. Change base urls for RM web-ui. (Thomas Graves via
|
||||||
|
acmurthy)
|
||||||
|
|
||||||
Release 0.22.0 - Unreleased
|
Release 0.22.0 - Unreleased
|
||||||
|
|
||||||
INCOMPATIBLE CHANGES
|
INCOMPATIBLE CHANGES
|
||||||
|
@ -149,7 +149,7 @@ public void start() {
|
|||||||
+ ":" + server.getPort());
|
+ ":" + server.getPort());
|
||||||
LOG.info("Instantiated MRClientService at " + this.bindAddress);
|
LOG.info("Instantiated MRClientService at " + this.bindAddress);
|
||||||
try {
|
try {
|
||||||
webApp = WebApps.$for("yarn", AppContext.class, appContext).with(conf).
|
webApp = WebApps.$for("mapreduce", AppContext.class, appContext).with(conf).
|
||||||
start(new AMWebApp());
|
start(new AMWebApp());
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
LOG.error("Webapps failed to start. Ignoring for now:", e);
|
LOG.error("Webapps failed to start. Ignoring for now:", e);
|
||||||
|
@ -38,9 +38,9 @@ public class NavBlock extends HtmlBlock {
|
|||||||
div("#nav").
|
div("#nav").
|
||||||
h3("Cluster").
|
h3("Cluster").
|
||||||
ul().
|
ul().
|
||||||
li().a(url(rmweb, prefix(), "cluster"), "About")._().
|
li().a(url(rmweb, "cluster", "cluster"), "About")._().
|
||||||
li().a(url(rmweb, prefix(), "apps"), "Applications")._().
|
li().a(url(rmweb, "cluster", "apps"), "Applications")._().
|
||||||
li().a(url(rmweb, prefix(), "scheduler"), "Scheduler")._()._().
|
li().a(url(rmweb, "cluster", "scheduler"), "Scheduler")._()._().
|
||||||
h3("Application").
|
h3("Application").
|
||||||
ul().
|
ul().
|
||||||
li().a(url("app/info"), "About")._().
|
li().a(url("app/info"), "About")._().
|
||||||
|
@ -85,7 +85,7 @@ protected void render(Block html) {
|
|||||||
if (containerId != null) {
|
if (containerId != null) {
|
||||||
String containerIdStr = ConverterUtils.toString(containerId);
|
String containerIdStr = ConverterUtils.toString(containerId);
|
||||||
nodeTd._(" ").
|
nodeTd._(" ").
|
||||||
a(".logslink", url("http://", nodeHttpAddr, "yarn", "containerlogs",
|
a(".logslink", url("http://", nodeHttpAddr, "node", "containerlogs",
|
||||||
containerIdStr), "logs");
|
containerIdStr), "logs");
|
||||||
}
|
}
|
||||||
nodeTd._().
|
nodeTd._().
|
||||||
|
@ -489,7 +489,7 @@ public static String getHistoryUrl(Configuration conf, ApplicationId appId)
|
|||||||
sb.append(address.getHostName());
|
sb.append(address.getHostName());
|
||||||
}
|
}
|
||||||
sb.append(":").append(address.getPort());
|
sb.append(":").append(address.getPort());
|
||||||
sb.append("/yarn/job/"); // TODO This will change when the history server
|
sb.append("/jobhistory/job/"); // TODO This will change when the history server
|
||||||
// understands apps.
|
// understands apps.
|
||||||
// TOOD Use JobId toString once UI stops using _id_id
|
// TOOD Use JobId toString once UI stops using _id_id
|
||||||
sb.append("job_").append(appId.getClusterTimestamp());
|
sb.append("job_").append(appId.getClusterTimestamp());
|
||||||
|
@ -135,7 +135,7 @@ private void initializeWebApp(Configuration conf) {
|
|||||||
webApp = new HsWebApp(history);
|
webApp = new HsWebApp(history);
|
||||||
String bindAddress = conf.get(JHAdminConfig.MR_HISTORY_WEBAPP_ADDRESS,
|
String bindAddress = conf.get(JHAdminConfig.MR_HISTORY_WEBAPP_ADDRESS,
|
||||||
JHAdminConfig.DEFAULT_MR_HISTORY_WEBAPP_ADDRESS);
|
JHAdminConfig.DEFAULT_MR_HISTORY_WEBAPP_ADDRESS);
|
||||||
WebApps.$for("yarn", this).at(bindAddress).start(webApp);
|
WebApps.$for("jobhistory", this).at(bindAddress).start(webApp);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -386,6 +386,6 @@ public static String getRMWebAppURL(Configuration conf) {
|
|||||||
// Use apps manager address to figure out the host for webapp
|
// Use apps manager address to figure out the host for webapp
|
||||||
addr = conf.get(YarnConfiguration.RM_ADDRESS, YarnConfiguration.DEFAULT_RM_ADDRESS);
|
addr = conf.get(YarnConfiguration.RM_ADDRESS, YarnConfiguration.DEFAULT_RM_ADDRESS);
|
||||||
String host = ADDR_SPLITTER.split(addr).iterator().next();
|
String host = ADDR_SPLITTER.split(addr).iterator().next();
|
||||||
return JOINER.join("http://", host, ":", port, "/");
|
return JOINER.join("http://", host, ":", port);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -0,0 +1,54 @@
|
|||||||
|
/**
|
||||||
|
* Licensed to the Apache Software Foundation (ASF) under one
|
||||||
|
* or more contributor license agreements. See the NOTICE file
|
||||||
|
* distributed with this work for additional information
|
||||||
|
* regarding copyright ownership. The ASF licenses this file
|
||||||
|
* to you under the Apache License, Version 2.0 (the
|
||||||
|
* "License"); you may not use this file except in compliance
|
||||||
|
* with the License. You may obtain a copy of the License at
|
||||||
|
*
|
||||||
|
* http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
*
|
||||||
|
* Unless required by applicable law or agreed to in writing, software
|
||||||
|
* distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
* See the License for the specific language governing permissions and
|
||||||
|
* limitations under the License.
|
||||||
|
*/
|
||||||
|
|
||||||
|
package org.apache.hadoop.yarn.conf;
|
||||||
|
|
||||||
|
import java.net.InetSocketAddress;
|
||||||
|
|
||||||
|
import junit.framework.Assert;
|
||||||
|
|
||||||
|
import org.apache.avro.ipc.Server;
|
||||||
|
import org.apache.hadoop.conf.Configuration;
|
||||||
|
import org.apache.hadoop.yarn.conf.YarnConfiguration;
|
||||||
|
import org.junit.Test;
|
||||||
|
|
||||||
|
public class TestYarnConfiguration {
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testDefaultRMWebUrl() throws Exception {
|
||||||
|
YarnConfiguration conf = new YarnConfiguration();
|
||||||
|
String rmWebUrl = YarnConfiguration.getRMWebAppURL(conf);
|
||||||
|
// shouldn't have a "/" on the end of the url as all the other uri routinnes
|
||||||
|
// specifically add slashes and Jetty doesn't handle double slashes.
|
||||||
|
Assert.assertEquals("RM Web Url is not correct", "http://0.0.0.0:8088",
|
||||||
|
rmWebUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
public void testRMWebUrlSpecified() throws Exception {
|
||||||
|
YarnConfiguration conf = new YarnConfiguration();
|
||||||
|
// seems a bit odd but right now we are forcing webapp for RM to be RM_ADDRESS
|
||||||
|
// for host and use the port from the RM_WEBAPP_ADDRESS
|
||||||
|
conf.set(YarnConfiguration.RM_WEBAPP_ADDRESS, "footesting:99110");
|
||||||
|
conf.set(YarnConfiguration.RM_ADDRESS, "rmtesting:9999");
|
||||||
|
String rmWebUrl = YarnConfiguration.getRMWebAppURL(conf);
|
||||||
|
Assert.assertEquals("RM Web Url is not correct", "http://rmtesting:99110",
|
||||||
|
rmWebUrl);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
@ -57,7 +57,7 @@ public synchronized void start() {
|
|||||||
LOG.info("Instantiating NMWebApp at " + bindAddress);
|
LOG.info("Instantiating NMWebApp at " + bindAddress);
|
||||||
try {
|
try {
|
||||||
this.webApp =
|
this.webApp =
|
||||||
WebApps.$for("yarn", Context.class, this.nmContext)
|
WebApps.$for("node", Context.class, this.nmContext)
|
||||||
.at(bindAddress).with(getConfig())
|
.at(bindAddress).with(getConfig())
|
||||||
.start(new NMWebApp(this.resourceView));
|
.start(new NMWebApp(this.resourceView));
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -385,7 +385,7 @@ public void handle(RMNodeEvent event) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
protected void startWepApp() {
|
protected void startWepApp() {
|
||||||
webApp = WebApps.$for("yarn", masterService).at(
|
webApp = WebApps.$for("cluster", masterService).at(
|
||||||
conf.get(YarnConfiguration.RM_WEBAPP_ADDRESS,
|
conf.get(YarnConfiguration.RM_WEBAPP_ADDRESS,
|
||||||
YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS)).
|
YarnConfiguration.DEFAULT_RM_WEBAPP_ADDRESS)).
|
||||||
start(new RMWebApp(this));
|
start(new RMWebApp(this));
|
||||||
|
@ -102,7 +102,7 @@ public void app() {
|
|||||||
.getMasterContainer();
|
.getMasterContainer();
|
||||||
if (masterContainer != null) {
|
if (masterContainer != null) {
|
||||||
String url = join("http://", masterContainer.getNodeHttpAddress(),
|
String url = join("http://", masterContainer.getNodeHttpAddress(),
|
||||||
"/yarn", "/containerlogs/",
|
"/node", "/containerlogs/",
|
||||||
ConverterUtils.toString(masterContainer.getId()));
|
ConverterUtils.toString(masterContainer.getId()));
|
||||||
info._("AM container logs:", url, url);
|
info._("AM container logs:", url, url);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user