命令查看yarn当前任务列表
1、说明 可以在linux任意目录下输入命令;
2、查看yarn的所有命令的使用方法
root@master /]# yarn application
20/06/24 14:44:08 INFO client.RMProxy: Connecting to ResourceManager at master/192.168.xxx.xx:8032
Invalid Command Usage :
usage: application
-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,RUN
NING,FINISHED,FAILED,KILLED
-appTypes <Types> Works with -list to filter applications
based on input comma-separated list of
application types.
-help Displays help for all commands.
-kill <Application ID> Kills the application.
-list List applications. Supports optional use
of -appTypes to filter applications based
on application type, and -appStates to
filter applications based on application
state.
-movetoqueue <Application ID> Moves the application to a different
queue.
-queue <Queue Name> Works with the movetoqueue command to
specify which queue to move an
application to.
-status <Application ID> Prints the status of the application.
3、查看yarn正在运行的任务列表
[root@master /]# yarn application -list
20/06/24 14:25:11 INFO client.RMProxy: Connecting to ResourceManager at master/192.168.xxx.xx:8032
Total number of applications (application-types: [] and states: [SUBMITTED, ACCEPTED, RUNNING]):1
Application-Id Application-Name Application-Type User Queue State Final-State Progress Tracking-URL
application_1592962175770_0004 kafka2sparkStreaming2Hbase SPARK root default RUNNING UNDEFINED 10% http://192.168.xxx.xx:4040
4、kill掉yarn正在运行的任务
[root@master /]# yarn application -kill application_1592962175770_0004
20/06/24 14:25:29 INFO client.RMProxy: Connecting to ResourceManager at master/192.168.xxx.xx:8032
Killing application application_1592962175770_0004
20/06/24 14:25:30 INFO impl.YarnClientImpl: Killed application application_1592962175770_0004
5、查找yarn已经完成的任务列表
[root@master /]# yarn application -appStates finished -list
20/06/24 14:28:07 INFO client.RMProxy: Connecting to ResourceManager at master/192.168.xxx.xx:8032
Total number of applications (application-types: [] and states: [FINISHED]):3
Application-Id Application-Name Application-Type User Queue State Final-State Progress Tracking-URL
application_1592962175770_0001 kafka2sparkStreaming2Hbase SPARK root default FINISHED SUCCEEDED 100% N/A
application_1592962175770_0002 kafka2sparkStreaming2Hbase SPARK root default FINISHED SUCCEEDED 100% N/A
application_1592962175770_0003 kafka2sparkStreaming2Hbase SPARK root default FINISHED SUCCEEDED 100%
6、查找yarn所有任务列表
[root@master /]# yarn application -appStates ALL -list
20/06/24 14:27:37 INFO client.RMProxy: Connecting to ResourceManager at master/192.168.xxx.xx:8032
Total number of applications (application-types: [] and states: [NEW, NEW_SAVING, SUBMITTED, ACCEPTED, RUNNING, FINISHED, FAILED, KILLED]):4
Application-Id Application-Name Application-Type User Queue State Final-State Progress Tracking-URL
application_1592962175770_0001 kafka2sparkStreaming2Hbase SPARK root default FINISHED SUCCEEDED 100% N/A
application_1592962175770_0002 kafka2sparkStreaming2Hbase SPARK root default FINISHED SUCCEEDED 100% N/A
application_1592962175770_0003 kafka2sparkStreaming2Hbase SPARK root default FINISHED SUCCEEDED 100% N/A
application_1592962175770_0004 kafka2sparkStreaming2Hbase SPARK root default KILLED KILLED 100% http://master:8088/cluster/app/application_1592962175770_0004