Yarn Commands

[ Go Back ]

Overview

Yarn commands are invoked by the bin/yarn script. Running the yarn script without any arguments prints the description for all commands.

Usage: yarn [--config confdir] COMMAND

Yarn has an option parsing framework that employs parsing generic options as well as running classes.

COMMAND_OPTIONSDescription
--config confdirOverwrites the default Configuration directory. Default is $HADOOP_PREFIX/conf.
COMMAND COMMAND_OPTIONSVarious commands with their options are described in the following sections. The commands have been grouped into User Commands and Administration Commands.

User Commands

Commands useful for users of a Hadoop cluster.

jar

Runs a jar file. Users can bundle their Yarn code in a jar file and execute it using this command.

  Usage: yarn jar <jar> [mainClass] args...

logs

Dump the container logs

  Usage: yarn logs <options>
COMMAND_OPTIONSDescription
-applicationId ApplicationIdSpecify an application id
-appOwner AppOwnerSpecify an application owner
-containerId ContainerIdSpecify a container id
-nodeAddress NodeAddressSpecify a node address

classpath

Prints the class path needed to get the Hadoop jar and the required libraries

  Usage: yarn classpath

version

Prints the version.

  Usage: yarn version

Administration Commands

Commands useful for administrators of a Hadoop cluster.

resourcemanager

Start the ResourceManager

  Usage: yarn resourcemanager

nodemanager

Start the NodeManager

  Usage: yarn nodemanager

proxyserver

Start the web proxy server

  Usage: yarn proxyserver

rmadmin

Runs ResourceManager admin client

  Usage: yarn rmadmin [-refreshQueues] [-refreshNodes] [-refreshUserToGroupsMapping] 
                      [-refreshSuperUserGroupsConfiguration] [-refreshAdminAcls] 
                      [-refreshServiceAcl] [-help [cmd]]
COMMAND_OPTIONSDescription
-refreshQueuesReload the queues' acls, states and scheduler specific properties. ResourceManager will reload the mapred-queues configuration file.
-refreshNodesRefresh the hosts information at the ResourceManager.
-refreshUserToGroupsMappingsRefresh user-to-groups mappings.
-refreshSuperUserGroupsConfigurationRefresh superuser proxy groups mappings.
-refreshAdminAclsRefresh acls for administration of ResourceManager
-refreshServiceAclReload the service-level authorization policy file ResoureceManager will reload the authorization policy file.
-help [cmd]Displays help for the given command or all commands if none is specified.

daemonlog

Get/Set the log level for each daemon.

  Usage: yarn daemonlog -getlevel <host:port> <name> 
  Usage: yarn daemonlog -setlevel <host:port> <name> <level>
COMMAND_OPTIONSDescription
-getlevel host:port namePrints the log level of the daemon running at host:port. This command internally connects to http://host:port/logLevel?log=name
-setlevel host:port name levelSets the log level of the daemon running at host:port. This command internally connects to http://host:port/logLevel?log=name