MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
#!/usr/bin/env bash
|
|
|
|
|
|
|
|
# Licensed to the Apache Software Foundation (ASF) under one or more
|
|
|
|
# contributor license agreements. See the NOTICE file distributed with
|
|
|
|
# this work for additional information regarding copyright ownership.
|
|
|
|
# The ASF licenses this file to You under the Apache License, Version 2.0
|
|
|
|
# (the "License"); you may not use this file except in compliance with
|
|
|
|
# the License. You may obtain a copy of the License at
|
|
|
|
#
|
|
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
|
|
#
|
|
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
|
|
# See the License for the specific language governing permissions and
|
|
|
|
# limitations under the License.
|
|
|
|
|
|
|
|
|
|
|
|
# The Hadoop command script
|
|
|
|
#
|
|
|
|
# Environment Variables
|
|
|
|
#
|
|
|
|
# JAVA_HOME The java implementation to use. Overrides JAVA_HOME.
|
|
|
|
#
|
2014-02-26 21:19:13 -05:00
|
|
|
# YARN_USER_CLASSPATH Additional user CLASSPATH entries.
|
|
|
|
#
|
|
|
|
# YARN_USER_CLASSPATH_FIRST If set to non empty value then the user classpath
|
|
|
|
# specified in YARN_USER_CLASSPATH will be
|
|
|
|
# appended at the beginning of YARN's final
|
|
|
|
# classpath instead of at the end.
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
#
|
|
|
|
# YARN_HEAPSIZE The maximum amount of heap to use, in MB.
|
|
|
|
# Default is 1000.
|
|
|
|
#
|
2012-03-05 14:06:43 -05:00
|
|
|
# YARN_{COMMAND}_HEAPSIZE overrides YARN_HEAPSIZE for a given command
|
|
|
|
# eg YARN_NODEMANAGER_HEAPSIZE sets the heap
|
|
|
|
# size for the NodeManager. If you set the
|
|
|
|
# heap size in YARN_{COMMAND}_OPTS or YARN_OPTS
|
|
|
|
# they take precedence.
|
|
|
|
#
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
# YARN_OPTS Extra Java runtime options.
|
|
|
|
#
|
|
|
|
# YARN_CLIENT_OPTS when the respective command is run.
|
2012-03-05 14:06:43 -05:00
|
|
|
# YARN_{COMMAND}_OPTS etc YARN_NODEMANAGER_OPTS applies to NodeManager
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
# for e.g. YARN_CLIENT_OPTS applies to
|
|
|
|
# more than one command (fs, dfs, fsck,
|
|
|
|
# dfsadmin etc)
|
|
|
|
#
|
2012-09-25 19:40:14 -04:00
|
|
|
# YARN_CONF_DIR Alternate conf dir. Default is ${HADOOP_YARN_HOME}/conf.
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
#
|
|
|
|
# YARN_ROOT_LOGGER The root appender. Default is INFO,console
|
|
|
|
#
|
|
|
|
|
2011-09-30 20:00:04 -04:00
|
|
|
bin=`dirname "${BASH_SOURCE-$0}"`
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
bin=`cd "$bin"; pwd`
|
|
|
|
|
2011-12-16 04:17:00 -05:00
|
|
|
DEFAULT_LIBEXEC_DIR="$bin"/../libexec
|
2015-01-09 18:01:33 -05:00
|
|
|
|
2011-11-17 20:01:20 -05:00
|
|
|
HADOOP_LIBEXEC_DIR=${HADOOP_LIBEXEC_DIR:-$DEFAULT_LIBEXEC_DIR}
|
|
|
|
. $HADOOP_LIBEXEC_DIR/yarn-config.sh
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
|
2013-02-22 13:37:30 -05:00
|
|
|
function print_usage(){
|
2015-02-12 05:01:31 -05:00
|
|
|
echo "Usage: yarn [--config confdir] [COMMAND | CLASSNAME]"
|
|
|
|
echo " CLASSNAME run the class named CLASSNAME"
|
|
|
|
echo " or"
|
|
|
|
echo " where COMMAND is one of:"
|
2014-07-21 21:33:17 -04:00
|
|
|
echo " resourcemanager -format-state-store deletes the RMStateStore"
|
|
|
|
echo " resourcemanager run the ResourceManager"
|
|
|
|
echo " nodemanager run a nodemanager on each slave"
|
|
|
|
echo " timelineserver run the timeline server"
|
|
|
|
echo " rmadmin admin tools"
|
2014-09-30 22:01:47 -04:00
|
|
|
echo " sharedcachemanager run the SharedCacheManager daemon"
|
2014-12-04 20:36:32 -05:00
|
|
|
echo " scmadmin SharedCacheManager admin tools"
|
2014-07-21 21:33:17 -04:00
|
|
|
echo " version print the version"
|
|
|
|
echo " jar <jar> run a jar file"
|
|
|
|
echo " application prints application(s)"
|
|
|
|
echo " report/kill application"
|
|
|
|
echo " applicationattempt prints applicationattempt(s)"
|
|
|
|
echo " report"
|
|
|
|
echo " container prints container(s) report"
|
|
|
|
echo " node prints node report(s)"
|
2014-11-06 23:48:31 -05:00
|
|
|
echo " queue prints queue information"
|
2014-07-21 21:33:17 -04:00
|
|
|
echo " logs dump container logs"
|
|
|
|
echo " classpath prints the class path needed to"
|
|
|
|
echo " get the Hadoop jar and the"
|
|
|
|
echo " required libraries"
|
2015-03-05 13:56:28 -05:00
|
|
|
echo " cluster prints cluster information"
|
2014-07-21 21:33:17 -04:00
|
|
|
echo " daemonlog get/set the log level for each"
|
|
|
|
echo " daemon"
|
2015-02-12 05:01:31 -05:00
|
|
|
echo ""
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
echo "Most commands print help when invoked w/o parameters."
|
2013-02-22 13:37:30 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
# if no args specified, show usage
|
|
|
|
if [ $# = 0 ]; then
|
|
|
|
print_usage
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# get arguments
|
|
|
|
COMMAND=$1
|
|
|
|
shift
|
|
|
|
|
2013-02-22 13:37:30 -05:00
|
|
|
case $COMMAND in
|
|
|
|
# usage flags
|
|
|
|
--help|-help|-h)
|
|
|
|
print_usage
|
|
|
|
exit
|
|
|
|
;;
|
|
|
|
esac
|
|
|
|
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
if [ -f "${YARN_CONF_DIR}/yarn-env.sh" ]; then
|
|
|
|
. "${YARN_CONF_DIR}/yarn-env.sh"
|
|
|
|
fi
|
|
|
|
|
|
|
|
# some Java parameters
|
|
|
|
if [ "$JAVA_HOME" != "" ]; then
|
|
|
|
#echo "run java in $JAVA_HOME"
|
|
|
|
JAVA_HOME=$JAVA_HOME
|
|
|
|
fi
|
|
|
|
|
|
|
|
if [ "$JAVA_HOME" = "" ]; then
|
|
|
|
echo "Error: JAVA_HOME is not set."
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
JAVA=$JAVA_HOME/bin/java
|
|
|
|
JAVA_HEAP_MAX=-Xmx1000m
|
|
|
|
|
|
|
|
# check envvars which might override default args
|
|
|
|
if [ "$YARN_HEAPSIZE" != "" ]; then
|
|
|
|
#echo "run with heapsize $YARN_HEAPSIZE"
|
|
|
|
JAVA_HEAP_MAX="-Xmx""$YARN_HEAPSIZE""m"
|
|
|
|
#echo $JAVA_HEAP_MAX
|
|
|
|
fi
|
|
|
|
|
|
|
|
# CLASSPATH initially contains $HADOOP_CONF_DIR & $YARN_CONF_DIR
|
2011-10-16 22:14:55 -04:00
|
|
|
if [ ! -d "$HADOOP_CONF_DIR" ]; then
|
|
|
|
echo No HADOOP_CONF_DIR set.
|
|
|
|
echo Please specify it either in yarn-env.sh or in the environment.
|
|
|
|
exit 1
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
2011-10-16 22:14:55 -04:00
|
|
|
|
2011-12-16 04:17:00 -05:00
|
|
|
CLASSPATH="${HADOOP_CONF_DIR}:${YARN_CONF_DIR}:${CLASSPATH}"
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
|
|
|
|
# for developers, add Hadoop classes to CLASSPATH
|
2012-09-25 19:40:14 -04:00
|
|
|
if [ -d "$HADOOP_YARN_HOME/yarn-api/target/classes" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/yarn-api/target/classes
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
2012-09-25 19:40:14 -04:00
|
|
|
if [ -d "$HADOOP_YARN_HOME/yarn-common/target/classes" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/yarn-common/target/classes
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
2012-09-25 19:40:14 -04:00
|
|
|
if [ -d "$HADOOP_YARN_HOME/yarn-mapreduce/target/classes" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/yarn-mapreduce/target/classes
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
2012-09-25 19:40:14 -04:00
|
|
|
if [ -d "$HADOOP_YARN_HOME/yarn-master-worker/target/classes" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/yarn-master-worker/target/classes
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
2012-09-25 19:40:14 -04:00
|
|
|
if [ -d "$HADOOP_YARN_HOME/yarn-server/yarn-server-nodemanager/target/classes" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/yarn-server/yarn-server-nodemanager/target/classes
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
2012-09-25 19:40:14 -04:00
|
|
|
if [ -d "$HADOOP_YARN_HOME/yarn-server/yarn-server-common/target/classes" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/yarn-server/yarn-server-common/target/classes
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
2012-09-25 19:40:14 -04:00
|
|
|
if [ -d "$HADOOP_YARN_HOME/yarn-server/yarn-server-resourcemanager/target/classes" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/yarn-server/yarn-server-resourcemanager/target/classes
|
2014-01-28 14:58:40 -05:00
|
|
|
fi
|
|
|
|
if [ -d "$HADOOP_YARN_HOME/yarn-server/yarn-server-applicationhistoryservice/target/classes" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/yarn-server/yarn-server-applicationhistoryservice/target/classes
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
2012-09-25 19:40:14 -04:00
|
|
|
if [ -d "$HADOOP_YARN_HOME/build/test/classes" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/target/test/classes
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
2012-09-25 19:40:14 -04:00
|
|
|
if [ -d "$HADOOP_YARN_HOME/build/tools" ]; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/build/tools
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
|
|
|
|
2012-09-25 19:40:14 -04:00
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/${YARN_DIR}/*
|
|
|
|
CLASSPATH=${CLASSPATH}:$HADOOP_YARN_HOME/${YARN_LIB_JARS_DIR}/*
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
|
2014-02-26 21:19:13 -05:00
|
|
|
# Add user defined YARN_USER_CLASSPATH to the class path (if defined)
|
|
|
|
if [ -n "$YARN_USER_CLASSPATH" ]; then
|
|
|
|
if [ -n "$YARN_USER_CLASSPATH_FIRST" ]; then
|
|
|
|
# User requested to add the custom entries at the beginning
|
|
|
|
CLASSPATH=${YARN_USER_CLASSPATH}:${CLASSPATH}
|
|
|
|
else
|
|
|
|
# By default we will just append the extra entries at the end
|
|
|
|
CLASSPATH=${CLASSPATH}:${YARN_USER_CLASSPATH}
|
|
|
|
fi
|
|
|
|
fi
|
|
|
|
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
# so that filenames w/ spaces are handled correctly in loops below
|
|
|
|
IFS=
|
|
|
|
|
|
|
|
# default log directory & file
|
|
|
|
if [ "$YARN_LOG_DIR" = "" ]; then
|
2012-09-25 19:40:14 -04:00
|
|
|
YARN_LOG_DIR="$HADOOP_YARN_HOME/logs"
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
fi
|
|
|
|
if [ "$YARN_LOGFILE" = "" ]; then
|
|
|
|
YARN_LOGFILE='yarn.log'
|
|
|
|
fi
|
|
|
|
|
|
|
|
# restore ordinary behaviour
|
|
|
|
unset IFS
|
|
|
|
|
|
|
|
# figure out which class to run
|
|
|
|
if [ "$COMMAND" = "classpath" ] ; then
|
2015-01-19 18:54:41 -05:00
|
|
|
if [ "$#" -gt 0 ]; then
|
|
|
|
CLASS=org.apache.hadoop.util.Classpath
|
|
|
|
else
|
|
|
|
if $cygwin; then
|
|
|
|
CLASSPATH=$(cygpath -p -w "$CLASSPATH" 2>/dev/null)
|
|
|
|
fi
|
|
|
|
echo $CLASSPATH
|
|
|
|
exit 0
|
2015-01-09 18:01:33 -05:00
|
|
|
fi
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
elif [ "$COMMAND" = "rmadmin" ] ; then
|
2013-06-16 17:43:27 -04:00
|
|
|
CLASS='org.apache.hadoop.yarn.client.cli.RMAdminCLI'
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
2014-12-17 14:47:24 -05:00
|
|
|
elif [ "$COMMAND" = "scmadmin" ] ; then
|
|
|
|
CLASS='org.apache.hadoop.yarn.client.SCMAdmin'
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
2014-01-28 15:00:38 -05:00
|
|
|
elif [ "$COMMAND" = "application" ] ||
|
|
|
|
[ "$COMMAND" = "applicationattempt" ] ||
|
|
|
|
[ "$COMMAND" = "container" ]; then
|
2012-10-08 18:19:43 -04:00
|
|
|
CLASS=org.apache.hadoop.yarn.client.cli.ApplicationCLI
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
2014-01-28 15:00:38 -05:00
|
|
|
set -- $COMMAND $@
|
2012-10-08 18:19:43 -04:00
|
|
|
elif [ "$COMMAND" = "node" ] ; then
|
|
|
|
CLASS=org.apache.hadoop.yarn.client.cli.NodeCLI
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
2014-11-07 15:00:49 -05:00
|
|
|
elif [ "$COMMAND" = "queue" ] ; then
|
2014-11-06 23:48:31 -05:00
|
|
|
CLASS=org.apache.hadoop.yarn.client.cli.QueueCLI
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
elif [ "$COMMAND" = "resourcemanager" ] ; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$YARN_CONF_DIR/rm-config/log4j.properties
|
|
|
|
CLASS='org.apache.hadoop.yarn.server.resourcemanager.ResourceManager'
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_RESOURCEMANAGER_OPTS"
|
2012-03-05 14:06:43 -05:00
|
|
|
if [ "$YARN_RESOURCEMANAGER_HEAPSIZE" != "" ]; then
|
|
|
|
JAVA_HEAP_MAX="-Xmx""$YARN_RESOURCEMANAGER_HEAPSIZE""m"
|
|
|
|
fi
|
2014-01-28 14:58:40 -05:00
|
|
|
elif [ "$COMMAND" = "historyserver" ] ; then
|
2014-05-10 20:05:31 -04:00
|
|
|
echo "DEPRECATED: Use of this command to start the timeline server is deprecated." 1>&2
|
|
|
|
echo "Instead use the timelineserver command for it." 1>&2
|
2014-01-28 14:58:40 -05:00
|
|
|
CLASSPATH=${CLASSPATH}:$YARN_CONF_DIR/ahs-config/log4j.properties
|
|
|
|
CLASS='org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer'
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_HISTORYSERVER_OPTS"
|
2014-02-03 23:47:23 -05:00
|
|
|
if [ "$YARN_HISTORYSERVER_HEAPSIZE" != "" ]; then
|
2014-01-28 14:58:40 -05:00
|
|
|
JAVA_HEAP_MAX="-Xmx""$YARN_HISTORYSERVER_HEAPSIZE""m"
|
2014-05-10 20:05:31 -04:00
|
|
|
fi
|
|
|
|
elif [ "$COMMAND" = "timelineserver" ] ; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$YARN_CONF_DIR/timelineserver-config/log4j.properties
|
|
|
|
CLASS='org.apache.hadoop.yarn.server.applicationhistoryservice.ApplicationHistoryServer'
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_TIMELINESERVER_OPTS"
|
|
|
|
if [ "$YARN_TIMELINESERVER_HEAPSIZE" != "" ]; then
|
|
|
|
JAVA_HEAP_MAX="-Xmx""$YARN_TIMELINESERVER_HEAPSIZE""m"
|
|
|
|
fi
|
2014-12-17 14:47:24 -05:00
|
|
|
elif [ "$COMMAND" = "sharedcachemanager" ] ; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$YARN_CONF_DIR/scm-config/log4j.properties
|
|
|
|
CLASS='org.apache.hadoop.yarn.server.sharedcachemanager.SharedCacheManager'
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_SHAREDCACHEMANAGER_OPTS"
|
|
|
|
if [ "$YARN_SHAREDCACHEMANAGER_HEAPSIZE" != "" ]; then
|
|
|
|
JAVA_HEAP_MAX="-Xmx""$YARN_SHAREDCACHEMANAGER_HEAPSIZE""m"
|
|
|
|
fi
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
elif [ "$COMMAND" = "nodemanager" ] ; then
|
|
|
|
CLASSPATH=${CLASSPATH}:$YARN_CONF_DIR/nm-config/log4j.properties
|
|
|
|
CLASS='org.apache.hadoop.yarn.server.nodemanager.NodeManager'
|
2012-03-09 12:38:10 -05:00
|
|
|
YARN_OPTS="$YARN_OPTS -server $YARN_NODEMANAGER_OPTS"
|
2012-03-05 14:06:43 -05:00
|
|
|
if [ "$YARN_NODEMANAGER_HEAPSIZE" != "" ]; then
|
|
|
|
JAVA_HEAP_MAX="-Xmx""$YARN_NODEMANAGER_HEAPSIZE""m"
|
|
|
|
fi
|
2011-10-26 02:32:26 -04:00
|
|
|
elif [ "$COMMAND" = "proxyserver" ] ; then
|
|
|
|
CLASS='org.apache.hadoop.yarn.server.webproxy.WebAppProxyServer'
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_PROXYSERVER_OPTS"
|
2012-03-05 14:06:43 -05:00
|
|
|
if [ "$YARN_PROXYSERVER_HEAPSIZE" != "" ]; then
|
|
|
|
JAVA_HEAP_MAX="-Xmx""$YARN_PROXYSERVER_HEAPSIZE""m"
|
|
|
|
fi
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
elif [ "$COMMAND" = "version" ] ; then
|
|
|
|
CLASS=org.apache.hadoop.util.VersionInfo
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
|
|
|
elif [ "$COMMAND" = "jar" ] ; then
|
|
|
|
CLASS=org.apache.hadoop.util.RunJar
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
|
|
|
elif [ "$COMMAND" = "logs" ] ; then
|
2013-10-03 22:38:17 -04:00
|
|
|
CLASS=org.apache.hadoop.yarn.client.cli.LogsCLI
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
|
|
|
elif [ "$COMMAND" = "daemonlog" ] ; then
|
|
|
|
CLASS=org.apache.hadoop.log.LogLevel
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
2015-03-05 13:56:28 -05:00
|
|
|
elif [ "$COMMAND" = "cluster" ] ; then
|
|
|
|
CLASS=org.apache.hadoop.yarn.client.cli.ClusterCLI
|
|
|
|
YARN_OPTS="$YARN_OPTS $YARN_CLIENT_OPTS"
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
else
|
|
|
|
CLASS=$COMMAND
|
|
|
|
fi
|
|
|
|
|
2015-01-09 18:01:33 -05:00
|
|
|
# cygwin path translation
|
|
|
|
if $cygwin; then
|
|
|
|
CLASSPATH=$(cygpath -p -w "$CLASSPATH" 2>/dev/null)
|
|
|
|
HADOOP_LOG_DIR=$(cygpath -w "$HADOOP_LOG_DIR" 2>/dev/null)
|
|
|
|
HADOOP_PREFIX=$(cygpath -w "$HADOOP_PREFIX" 2>/dev/null)
|
|
|
|
HADOOP_CONF_DIR=$(cygpath -w "$HADOOP_CONF_DIR" 2>/dev/null)
|
|
|
|
HADOOP_COMMON_HOME=$(cygpath -w "$HADOOP_COMMON_HOME" 2>/dev/null)
|
|
|
|
HADOOP_HDFS_HOME=$(cygpath -w "$HADOOP_HDFS_HOME" 2>/dev/null)
|
|
|
|
HADOOP_YARN_HOME=$(cygpath -w "$HADOOP_YARN_HOME" 2>/dev/null)
|
|
|
|
HADOOP_MAPRED_HOME=$(cygpath -w "$HADOOP_MAPRED_HOME" 2>/dev/null)
|
|
|
|
YARN_LOG_DIR=$(cygpath -w "$YARN_LOG_DIR" 2>/dev/null)
|
|
|
|
fi
|
|
|
|
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
YARN_OPTS="$YARN_OPTS -Dhadoop.log.dir=$YARN_LOG_DIR"
|
|
|
|
YARN_OPTS="$YARN_OPTS -Dyarn.log.dir=$YARN_LOG_DIR"
|
|
|
|
YARN_OPTS="$YARN_OPTS -Dhadoop.log.file=$YARN_LOGFILE"
|
|
|
|
YARN_OPTS="$YARN_OPTS -Dyarn.log.file=$YARN_LOGFILE"
|
2012-09-25 19:40:14 -04:00
|
|
|
YARN_OPTS="$YARN_OPTS -Dyarn.home.dir=$HADOOP_YARN_HOME"
|
2015-01-09 18:01:33 -05:00
|
|
|
HADOOP_HOME=$HADOOP_PREFIX
|
|
|
|
if $cygwin; then
|
|
|
|
HADOOP_HOME=$(cygpath -w "$HADOOP_HOME" 2>/dev/null)
|
|
|
|
fi
|
|
|
|
export HADOOP_HOME
|
|
|
|
YARN_OPTS="$YARN_OPTS -Dhadoop.home.dir=$HADOOP_HOME"
|
2014-11-13 00:44:05 -05:00
|
|
|
YARN_OPTS="$YARN_OPTS -Dhadoop.root.logger=${YARN_ROOT_LOGGER:-${HADOOP_LOGLEVEL},console}"
|
|
|
|
YARN_OPTS="$YARN_OPTS -Dyarn.root.logger=${YARN_ROOT_LOGGER:-${HADOOP_LOGLEVEL},console}"
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
if [ "x$JAVA_LIBRARY_PATH" != "x" ]; then
|
2015-01-09 18:01:33 -05:00
|
|
|
if $cygwin; then
|
|
|
|
JAVA_LIBRARY_PATH=$(cygpath -w "$JAVA_LIBRARY_PATH" 2>/dev/null)
|
|
|
|
fi
|
MAPREDUCE-279. MapReduce 2.0. Merging MR-279 branch into trunk. Contributed by Arun C Murthy, Christopher Douglas, Devaraj Das, Greg Roelofs, Jeffrey Naisbitt, Josh Wills, Jonathan Eagles, Krishna Ramachandran, Luke Lu, Mahadev Konar, Robert Evans, Sharad Agarwal, Siddharth Seth, Thomas Graves, and Vinod Kumar Vavilapalli.
git-svn-id: https://svn.apache.org/repos/asf/hadoop/common/trunk@1159166 13f79535-47bb-0310-9956-ffa450edef68
2011-08-18 07:07:10 -04:00
|
|
|
YARN_OPTS="$YARN_OPTS -Djava.library.path=$JAVA_LIBRARY_PATH"
|
|
|
|
fi
|
|
|
|
|
|
|
|
exec "$JAVA" -Dproc_$COMMAND $JAVA_HEAP_MAX $YARN_OPTS -classpath "$CLASSPATH" $CLASS "$@"
|