YARN CLI provides three types of commands. The first type is for users who wish to use YARN infrastructure for developing applications. The second type are administrative commands, which provide monitoring and administrative capabilities of all components of YARN including resource manager, application master, and timeline server. The third type are daemon commands, which are used for maintenance purposes covering stopping, starting, and restarting of daemons. Now, let’s look at user commands for YARN:
Command | Parameters | Description | Important Parameters |
application | yarn application <command> <parameters> | All actions pertaining to applications such as print and kill. | - appID <applicationID> - kill <applicationID> - list - status <applicationID> |
applicationattempt | yarn applicationattempt <parameter> | Prints an application attempt(s) report. | |
classpath | yarn classpath --jar <path> | Prints the classpath needed for the given JARor prints the current classpath set when passed without a parameter. | |
container | yarn container <parameters> | Prints a container report. | -status <containerID> -list <applicationattemptID> |
jar | yarn jar <jar file> <mainClassName> | Runs the given JAR file in YARN. The main class name is needed. | |
logs | yarn logs <command> <parameter> | Dumps the log for a given application, container, or owner. | -applicationId <applicationID> - containerId <containerID> |
node | yarn node <command> <parameter> | Prints node-related reports. | -all prints it for all nodes - list - lists all nodes |
queue | yarn queue <options> | Prints queue information. | -status <queueName> |
version | Prints current Hadoop version. | ||
envvars | Displays current environment variables. |
The following screenshot shows how a command is fired on YARN:

When a command is run, the YARN client connects to the Resource Manager default port to get the details—in this case, node listing. More details about administrative and daemon commands can be read here.