diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java index 1ee54e898a..273a3b9b3f 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java @@ -270,8 +270,14 @@ public void testRMWebAppRedirect() throws YarnException, String header = getHeader("Refresh", rm2Url); assertTrue(header.contains("; url=" + rm1Url)); - // standby RM links /conf, /stacks, /logLevel, /metrics, /jmx, - // /static, /logs, /cluster/cluster as well as webService + header = getHeader("Refresh", rm2Url + "/metrics"); + assertTrue(header.contains("; url=" + rm1Url)); + + header = getHeader("Refresh", rm2Url + "/jmx"); + assertTrue(header.contains("; url=" + rm1Url)); + + // standby RM links /conf, /stacks, /logLevel, /static, /logs, + // /cluster/cluster as well as webService // /ws/v1/cluster/info should not be redirected to active RM header = getHeader("Refresh", rm2Url + "/cluster/cluster"); assertEquals(null, header); @@ -285,12 +291,6 @@ public void testRMWebAppRedirect() throws YarnException, header = getHeader("Refresh", rm2Url + "/logLevel"); assertEquals(null, header); - header = getHeader("Refresh", rm2Url + "/metrics"); - assertEquals(null, header); - - header = getHeader("Refresh", rm2Url + "/jmx"); - assertEquals(null, header); - header = getHeader("Refresh", rm2Url + "/static"); assertEquals(null, header); diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java index 653432b8a9..49fd1f54de 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java @@ -46,7 +46,7 @@ public class RMWebAppFilter extends GuiceContainer { // define a set of URIs which do not need to do redirection private static final Set NON_REDIRECTED_URIS = Sets.newHashSet( - "/conf", "/stacks", "/logLevel", "/metrics", "/jmx", "/logs"); + "/conf", "/stacks", "/logLevel", "/logs"); @Inject public RMWebAppFilter(Injector injector) {