diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn index 54daeaafbe..dbab397f26 100755 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn @@ -175,6 +175,10 @@ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}" router) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" HADOOP_CLASSNAME='org.apache.hadoop.yarn.server.router.Router' + # Backwards compatibility + if [[ -n "${YARN_ROUTER_HEAPSIZE}" ]]; then + HADOOP_HEAPSIZE_MAX="${YARN_ROUTER_HEAPSIZE}" + fi ;; schedulerconf) HADOOP_CLASSNAME='org.apache.hadoop.yarn.client.cli.SchedConfCLI' diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd b/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd index e1ac11287f..3a60794fad 100644 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn.cmd @@ -260,6 +260,9 @@ goto :eof set CLASSPATH=%CLASSPATH%;%YARN_CONF_DIR%\router-config\log4j.properties set CLASS=org.apache.hadoop.yarn.server.router.Router set YARN_OPTS=%YARN_OPTS% %HADOOP_ROUTER_OPTS% + if defined YARN_ROUTER_HEAPSIZE ( + set JAVA_HEAP_MAX=-Xmx%YARN_ROUTER_HEAPSIZE%m + ) goto :eof :nodemanager diff --git a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh index 7cd1390ca9..b3650a6120 100644 --- a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh +++ b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh @@ -147,6 +147,11 @@ # Router specific parameters ### +# Specify the max heapsize for the Router. If no units are +# given, it will be assumed to be in MB. +# Default is the same as HADOOP_HEAPSIZE_MAX +#export YARN_ROUTER_HEAPSIZE= + # Specify the JVM options to be used when starting the Router. # These options will be appended to the options specified as HADOOP_OPTS # and therefore may override any similar flags set in HADOOP_OPTS