yarn常用命令
1、yarn application 查看任务
1.1 列出所有 Application:
yarn application -list
1.2 根据 Application 状态过滤:yarn application -list -appStates (所有状态:ALL、NEW、
NEW_SAVING、SUBMITTED、ACCEPTED、RUNNING、FINISHED、FAILED、KILLED)
yarn application -list -appStates
1.3 Kill 掉 Application:
yarn application -kill <ApplicationId>
2、yarn logs 查看日志
2.1 查询 Application 日志:yarn logs -applicationId <ApplicationId>
yarn logs -applicationId application_1612577921195_0001
2.2 查询 Container 日志:yarn logs -applicationId <ApplicationId> -containerId <ContainerId>
yarn logs -applicationId application_1612577921195_0001 -containerIdcontainer_1612577921195_0001_01_000001
3、yarn applicationattempt 查看尝试运行的任务
3.1 列出所有 Application 尝试的列表:yarn applicationattempt -list <ApplicationId>
yarn applicationattempt -list application_1612577921195_0001
3.2 打印 ApplicationAttemp 状态:yarn applicationattempt -status <ApplicationAttemptId>
yarn applicationattempt -status appattempt_1612577921195_0001_000001
4、yarn container 查看容器
4.1 列出所有 Container:yarn container -list <ApplicationAttemptId>
yarn container -list appattempt_1612577921195_0001_000001
4.2 打印 Container 状态:yarn container -status <ContainerId>
yarn container -status container_1612577921195_0001_01_000001
注:只有在任务跑的途中才能看到 container 的状态
5、yarn node 查看节点状态
5.1 列出所有节点:yarn node -list -all
yarn node -list -all
6、yarn rmadmin 更新配置
6.1 加载队列配置:yarn rmadmin -refreshQueues
在修改queue相关配置参数后,可以使用此命令,不需要重启yarn。
yarn rmadmin -refreshQueues
7、yarn queue 查看队列
7.1 打印队列信息:yarn queue -status <QueueName>
yarn queue -status default