From 109705f07781a8704452315fd999270d89f5b313 Mon Sep 17 00:00:00 2001 From: Sanford Ryza Date: Fri, 9 Aug 2013 21:10:03 +0000 Subject: [PATCH] YARN-1046. Disable mem monitoring my default in MiniYARNCluster (Karthik Kambatla via Sandy Ryza) git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1512493 13f79535-47bb-0310-9956-ffa450edef68 --- hadoop-yarn-project/CHANGES.txt | 3 +++ .../org/apache/hadoop/yarn/conf/YarnConfiguration.java | 8 ++++++++ .../org/apache/hadoop/yarn/server/MiniYARNCluster.java | 10 ++++++++++ 3 files changed, 21 insertions(+) diff --git a/hadoop-yarn-project/CHANGES.txt b/hadoop-yarn-project/CHANGES.txt index 0a13cafa4d2..c34f1494ce0 100644 --- a/hadoop-yarn-project/CHANGES.txt +++ b/hadoop-yarn-project/CHANGES.txt @@ -514,6 +514,9 @@ Release 2.1.0-beta - 2013-08-06 YARN-84. Use Builder to build RPC server. (Brandon Li via suresh) + YARN-1046. Disable mem monitoring by default in MiniYARNCluster. (Karthik + Kambatla via Sandy Ryza) + OPTIMIZATIONS YARN-512. Log aggregation root directory check is more expensive than it diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java index b14e6522520..065fb6344c6 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-api/src/main/java/org/apache/hadoop/yarn/conf/YarnConfiguration.java @@ -711,6 +711,14 @@ public class YarnConfiguration extends Configuration { */ public static boolean DEFAULT_YARN_MINICLUSTER_FIXED_PORTS = false; + /** + * Whether users are explicitly trying to control resource monitoring + * configuration for the MiniYARNCluster. Disabled by default. + */ + public static final String YARN_MINICLUSTER_CONTROL_RESOURCE_MONITORING = + YARN_PREFIX + "minicluster.control-resource-monitoring"; + public static final boolean + DEFAULT_YARN_MINICLUSTER_CONTROL_RESOURCE_MONITORING = false; /** The log directory for the containers */ public static final String YARN_APP_CONTAINER_LOG_DIR = diff --git a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java index 144b111f830..cba27e4b323 100644 --- a/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java +++ b/hadoop-yarn-project/hadoop-yarn/hadoop-yarn-server/hadoop-yarn-server-tests/src/test/java/org/apache/hadoop/yarn/server/MiniYARNCluster.java @@ -304,6 +304,16 @@ public class MiniYARNCluster extends CompositeService { MiniYARNCluster.getHostname() + ":0"); getConfig().set(YarnConfiguration.NM_WEBAPP_ADDRESS, MiniYARNCluster.getHostname() + ":0"); + + // Disable resource checks by default + if (!getConfig().getBoolean( + YarnConfiguration.YARN_MINICLUSTER_CONTROL_RESOURCE_MONITORING, + YarnConfiguration. + DEFAULT_YARN_MINICLUSTER_CONTROL_RESOURCE_MONITORING)) { + getConfig().setBoolean(YarnConfiguration.NM_PMEM_CHECK_ENABLED, false); + getConfig().setBoolean(YarnConfiguration.NM_VMEM_CHECK_ENABLED, false); + } + LOG.info("Starting NM: " + index); nodeManagers[index].init(getConfig()); new Thread() {