起因:YARN 使用capability schedule queue調度container,spark 的app卡死在YARN的隊列里面無法出來,無奈請教大神時,可用[yarn application [option]]命令去操縱yarn的應用。
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
可以查看yarnapplication的狀態,配合-list使用,e.g:
yarn application -list -appStates FAILED
[output descbribe]:
[1.總數]Total number of applications (application-types: [] and states: [FAILED]):4
[2.信息表頭]
Application-Id Application-Name Application-Type User Queue State Final-State Progress Tracking-URL
[3.對應表頭的內容]
application_1489637571965_0120 org.apache.spark.sql.hive.thriftserver.HiveThriftServer2 SPARK hdfs root.hdfs FAILED FAILED 0% http://m.test.com:8088/cluster/app/application_1489637571965_0120
-appTypes <Types> Works with -list to filter applications
based on input comma-separated list of
application types.
查看application的類型:如SPARK、ZEPPELIN等等。
-help Displays help for all commands.
-kill <Application ID> Kills the application.
注意使用這個命令要小心,kill掉可能會導致zeppelin只有一個sparkContext時,notebook無法執行。
-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.
將某個ID application移出到不同的隊列
-queue <Queue Name> Works with the movetoqueue command to
specify which queue to move an
application to.
結合-list 和 -movetoqueue使用,e.g:
yarn application -list -queue root.hdfs
[output]:
Total number of applications (application-types: [] and states: [SUBMITTED, ACCEPTED, RUNNING]):2
Application-Id Application-Name Application-Type User Queue State Final-State Progress Tracking-URL
application_1489637571965_0193 Zeppelin SPARK hdfs root.hdfs RUNNING UNDEFINED 10% http://192.168.66.49:4040
application_1489637571965_0165 org.apache.spark.sql.hive.thriftserver.HiveThriftServer2 SPARK hdfs root.default RUNNING UNDEFINED 10% http://192.168.66.49:5050
-status <Application ID> Prints the status of the application.
查看對應id application的狀態信息