命令查看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.230.21: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.230.21: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.230.21: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.230.21: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.230.21: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.230.21: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

 

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章