From 2c4e0f33e941011aed4ab341c4958f38afa85640 Mon Sep 17 00:00:00 2001 From: Gour Saha Date: Thu, 10 Nov 2016 11:35:02 -0800 Subject: [PATCH] YARN-5808. Add gc log options to the yarn daemon script when starting services-api. Contributed by Billie Rinaldi --- hadoop-yarn-project/hadoop-yarn/bin/yarn | 16 ++++++++-------- hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh | 12 ++++++++++++ 2 files changed, 20 insertions(+), 8 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/bin/yarn b/hadoop-yarn-project/hadoop-yarn/bin/yarn index 556843a789..594481d42e 100755 --- a/hadoop-yarn-project/hadoop-yarn/bin/yarn +++ b/hadoop-yarn-project/hadoop-yarn/bin/yarn @@ -49,7 +49,7 @@ function hadoop_usage hadoop_add_subcommand "router" daemon "run the Router daemon" hadoop_add_subcommand "schedulerconf" client "Updates scheduler configuration" hadoop_add_subcommand "scmadmin" admin "SharedCacheManager admin tools" - hadoop_add_subcommand "services-api" "run slider services api" + hadoop_add_subcommand "servicesapi" "run slider services api" hadoop_add_subcommand "sharedcachemanager" daemon "run the SharedCacheManager daemon" hadoop_add_subcommand "slider" "run a slider app" hadoop_add_subcommand "timelinereader" client "run the timeline reader server" @@ -151,20 +151,20 @@ function yarncmd_case scmadmin) HADOOP_CLASSNAME='org.apache.hadoop.yarn.client.SCMAdmin' ;; - services-api) + servicesapi) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/slider"'/*' hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/services-api"'/*' HADOOP_CLASSNAME='org.apache.hadoop.yarn.services.webapp.ApplicationApiWebApp' - hadoop_debug "Append YARN_CLIENT_OPTS onto HADOOP_OPTS" - HADOOP_OPTS="${HADOOP_OPTS} ${YARN_CLIENT_OPTS} \ --Dslider.libdir=${HADOOP_YARN_HOME}/${YARN_DIR},\ + local sld="${HADOOP_YARN_HOME}/${YARN_DIR},\ ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR},\ ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/slider,\ ${HADOOP_HDFS_HOME}/${HDFS_DIR},\ ${HADOOP_HDFS_HOME}/${HDFS_LIB_JARS_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}" + hadoop_translate_cygwin_path sld + hadoop_add_param HADOOP_OPTS slider.libdir "-Dslider.libdir=${sld}" ;; sharedcachemanager) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" @@ -173,15 +173,15 @@ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}" slider) hadoop_add_classpath "${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/slider"'/*' HADOOP_CLASSNAME='org.apache.slider.Slider' - hadoop_debug "Append YARN_CLIENT_OPTS onto HADOOP_OPTS" - HADOOP_OPTS="${HADOOP_OPTS} ${YARN_CLIENT_OPTS} \ --Dslider.libdir=${HADOOP_YARN_HOME}/${YARN_DIR},\ + local sld="${HADOOP_YARN_HOME}/${YARN_DIR},\ ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR},\ ${HADOOP_YARN_HOME}/${YARN_LIB_JARS_DIR}/slider,\ ${HADOOP_HDFS_HOME}/${HDFS_DIR},\ ${HADOOP_HDFS_HOME}/${HDFS_LIB_JARS_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_DIR},\ ${HADOOP_COMMON_HOME}/${HADOOP_COMMON_LIB_JARS_DIR}" + hadoop_translate_cygwin_path sld + hadoop_add_param HADOOP_OPTS slider.libdir "-Dslider.libdir=${sld}" ;; timelinereader) HADOOP_SUBCMD_SUPPORTDAEMONIZATION="true" diff --git a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh index be42298c0b..02aec3be48 100644 --- a/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh +++ b/hadoop-yarn-project/hadoop-yarn/conf/yarn-env.sh @@ -148,3 +148,15 @@ # See ResourceManager for some examples # #export YARN_ROUTER_OPTS= + +### +# Services API specific parameters +### +# Specify the JVM options to be used when starting the services API. +# +# These options will be appended to the options specified as HADOOP_OPTS +# and therefore may override any similar flags set in HADOOP_OPTS +# +# See ResourceManager for some examples +# +#export YARN_SERVICESAPI_OPTS="-verbose:gc -XX:+PrintGCDetails -XX:+PrintGCTimeStamps -XX:+PrintGCDateStamps -Xloggc:${HADOOP_LOG_DIR}/gc-servicesapi.log-$(date +'%Y%m%d%H%M')"