Просмотр исходного кода

YARN-2599. Standby RM should expose jmx endpoint. Contributed by Rohith Sharma K S.

Sunil G 6 лет назад
Родитель
Сommit
0e0ddfaf24

+ 4 - 3
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-client/src/test/java/org/apache/hadoop/yarn/client/TestRMFailover.java

@@ -294,10 +294,8 @@ public class TestRMFailover extends ClientBaseWithFixes {
     redirectURL = getRedirectURL(rm2Url + "/metrics");
     assertEquals(redirectURL,rm1Url + "/metrics");
 
-    redirectURL = getRedirectURL(rm2Url + "/jmx?param1=value1+x&param2=y");
-    assertEquals(rm1Url + "/jmx?param1=value1+x&param2=y", redirectURL);
 
-    // standby RM links /conf, /stacks, /logLevel, /static, /logs,
+    // standby RM links /conf, /stacks, /logLevel, /static, /logs, /jmx
     // /cluster/cluster as well as webService
     // /ws/v1/cluster/info should not be redirected to active RM
     redirectURL = getRedirectURL(rm2Url + "/cluster/cluster");
@@ -318,6 +316,9 @@ public class TestRMFailover extends ClientBaseWithFixes {
     redirectURL = getRedirectURL(rm2Url + "/logs");
     assertNull(redirectURL);
 
+    redirectURL = getRedirectURL(rm2Url + "/jmx?param1=value1+x&param2=y");
+    assertNull(redirectURL);
+
     redirectURL = getRedirectURL(rm2Url + "/ws/v1/cluster/info");
     assertNull(redirectURL);
 

+ 3 - 2
hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-resourcemanager/src/main/java/org/apache/hadoop/yarn/server/resourcemanager/webapp/RMWebAppFilter.java

@@ -69,7 +69,8 @@ public class RMWebAppFilter extends GuiceContainer {
 
   // define a set of URIs which do not need to do redirection
   private static final Set<String> NON_REDIRECTED_URIS = Sets.newHashSet(
-      "/conf", "/stacks", "/logLevel", "/logs", IsActiveServlet.PATH_SPEC);
+      "/conf", "/stacks", "/logLevel", "/logs", IsActiveServlet.PATH_SPEC,
+      "/jmx");
   private String path;
   private boolean ahsEnabled;
   private String ahsPageURLPrefix;
@@ -274,4 +275,4 @@ public class RMWebAppFilter extends GuiceContainer {
     long baseTime = BASIC_SLEEP_TIME * (1L << retries);
     return (int) (baseTime * (randnum.nextDouble() + 0.5));
   }
-}
+}