<>一、 yarn常用命令:
 <>1.yarn application 查看任务
(1)列出所有Application
yarn application -list
 (2)根据 Application 状态过滤:yarn application -list -appStates 
(所有状态:ALL、NEW、NEW_SAVING、SUBMITTED、ACCEPTED、RUNNING、FINISHED、FAILED、KILLED)
 <>2.yarn logs 查看日志
(1)查看Application 日志
yarn logs -applicationId 
(2)查询Container 日志
 yarn logs -applicationId -containerId 
 <>3.yarn applicationattempt 查看尝试运行的任务
(1)列出所有 Application 尝试的列表
 yarn applicationattempt -list 
 (2)打印 ApplicationAttemp 状态
 yarn applicationattempt -status 
 <>4. yarn container查看容器
(1)列出所有 Container yarn container -list ApplicationAttemptId>
 (2)打印 Container 状态
 yarn container -status ContainerId>
 <>5.yarn node 查看节点状态
列出所有节点
 yarn node -list -all
 <>6.yarn rmadmin 跟新配置
yarn rmadmin -refreshQueues
 <>7.yarn queue 查看队列
打印队列信息
 yarn queue -status 
 <>二、常用命令汇总
 <>1. yarn 命令行查看资源状态:
yarn top
 <>2.查看指定queue使用情况:
yarn queue -status root.user.xxxx
 示例: yarn queue -status root.j042x0
 <>3.查看app状态:
yarn application -list -appStates 、 yarn application -list -appTypes
 <>4.移动app到对应的队列:
示例:yarn application -movetoqueue application_1528080031923_0067 -queue 
root.j042x0
 <>5.kill掉某个app任务:
 yarn application -kill applicationId 例如:要杀掉这个任务:yarn application -kill 
application_1528080031923_0067 
 <>6.查看Application 日志:
 yarn logs -applicationId 示例:yarn logs -applicationId 
application_1528080031923_0064 
 <>7.查看app状态命令:
yarn applicationattempt -list applicationId
 <>8.打印类路径:
yarn classpath --glob
 <>9. 打印正在执行任务的容器信息:
yarn container -list appattemptId
 示例:yarn container -list appattempt_1528080031923_0068_000001
 <>10.打印当前容器信息:
yarn container -status containerId
 <>11. 提交任务到yarn:
yarn jar [mainClass] args…
 <>12. 查看yarn集群所有节点信息:
yarn node -all -list
 <>13. yarn application -list 根据 Application 状态过滤:
yarn application -list -appStates 
(所有状态:ALL、NEW、NEW_SAVING、SUBMITTED、ACCEPTED、RUNNING、FINISHED、FAILED、KILLED)
 示例:yarn application -list -appStates RUNNING 查看正在运行的应用的状态信息