From 41db07d532f41fd35b11935b2bb042973831951b Mon Sep 17 00:00:00 2001 From: Naganarasimha Date: Tue, 10 Jan 2017 15:35:01 +0530 Subject: [PATCH] YARN-5937. stop-yarn.sh is not able to gracefully stop node managers. Contributed by Weiwei Yang. --- hadoop-yarn-project/hadoop-yarn/bin/stop-yarn.sh | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hadoop-yarn-project/hadoop-yarn/bin/stop-yarn.sh b/hadoop-yarn-project/hadoop-yarn/bin/stop-yarn.sh index 1ed52dd18a..f6c6b781b3 100755 --- a/hadoop-yarn-project/hadoop-yarn/bin/stop-yarn.sh +++ b/hadoop-yarn-project/hadoop-yarn/bin/stop-yarn.sh @@ -42,6 +42,14 @@ else exit 1 fi +# stop nodemanager +echo "Stopping nodemanagers" +"${HADOOP_YARN_HOME}/bin/yarn" \ + --config "${HADOOP_CONF_DIR}" \ + --workers \ + --daemon stop \ + nodemanager + # stop resourceManager HARM=$("${HADOOP_HDFS_HOME}/bin/hdfs" getconf -confKey yarn.resourcemanager.ha.enabled 2>&-) if [[ ${HARM} = "false" ]]; then @@ -67,14 +75,6 @@ else resourcemanager fi -# stop nodemanager -echo "Stopping nodemanagers" -"${HADOOP_YARN_HOME}/bin/yarn" \ - --config "${HADOOP_CONF_DIR}" \ - --workers \ - --daemon stop \ - nodemanager - # stop proxyserver PROXYSERVER=$("${HADOOP_HDFS_HOME}/bin/hdfs" getconf -confKey yarn.web-proxy.address 2>&- | cut -f1 -d:) if [[ -n ${PROXYSERVER} ]]; then