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_OPTIONS Description
--config confdir Overwrites the default Configuration directory. Default is ${HADOOP_PREFIX}/conf.
COMMAND COMMAND_OPTIONS Various 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...

application

Prints application(s) report/kill application

  Usage: yarn application <options>
COMMAND_OPTIONS Description
-list Lists applications from the RM. Supports optional use of -appTypes to filter applications based on application type, and -appStates to filter applications based on application state.
-appStates States Works with -list to filter applications based on input comma-separated list of application states. The valid application state can be one of the following:  
ALL, NEW, NEW_SAVING, SUBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED
-appTypes Types Works with -list to filter applications based on input comma-separated list of application types.
-status ApplicationId Prints the status of the application.
-kill ApplicationId Kills the application.

node

Prints node report(s)

  Usage: yarn node <options>
COMMAND_OPTIONS Description
-list Lists all running nodes. Supports optional use of -states to filter nodes based on node state, and -all to list all nodes.
-states States Works with -list to filter nodes based on input comma-separated list of node states.
-all Works with -list to list all nodes.
-status NodeId Prints the status report of the node.

logs

Dump the container logs

  Usage: yarn logs -applicationId <application ID> <options>
COMMAND_OPTIONS Description
-applicationId <application ID> Specifies an application id
-appOwner AppOwner AppOwner (assumed to be current user if not specified)
-containerId ContainerId ContainerId (must be specified if node address is specified)
-nodeAddress NodeAddress NodeAddress in the format nodename:port (must be specified if container id is specified)

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] [-getGroups [username]] [-help [cmd]]
                      [-transitionToActive <serviceId>]
                      [-transitionToStandby <serviceId>]
                      [-getServiceState <serviceId>]
                      [-checkHealth <serviceId>]
COMMAND_OPTIONS Description
-refreshQueues Reload the queues' acls, states and scheduler specific properties. ResourceManager will reload the mapred-queues configuration file.
-refreshNodes Refresh the hosts information at the ResourceManager.
-refreshUserToGroupsMappings Refresh user-to-groups mappings.
-refreshSuperUserGroupsConfiguration Refresh superuser proxy groups mappings.
-refreshAdminAcls Refresh acls for administration of ResourceManager
-refreshServiceAcl Reload the service-level authorization policy file ResourceManager will reload the authorization policy file.
-getGroups [username] Get groups the specified user belongs to.
-help [cmd] Displays help for the given command or all commands if none is specified.
-transitionToActive <serviceId> Transitions the service into Active state.
-transitionToStandby <serviceId> Transitions the service into Standby state.
-getServiceState <serviceId> Returns the state of the service.
-checkHealth <serviceId> Requests that the service perform a health check. The RMAdmin tool will exit with a non-zero exit code if the check fails.

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_OPTIONS Description
-getlevel <host:port> <name> Prints 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> <level> Sets the log level of the daemon running at <host:port>. This command internally connects to http://<host:port>/logLevel?log=<name>