学习 YARN(四):命令行
source link: https://www.tuicool.com/articles/rENBRnI
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
更新至 Hadoop 2.9.2 版本
Application
YARN 应用相关命令。实现类: org.apache.hadoop.yarn.client.cli.ApplicationCLI
。
显示运行中的任务:
yarn application -list –appStates RUNNING
选项 appStates
任务状态包括:ALL、NEW、NEW_SAVING、SUBMITTED、ACCEPTED、RUNNING、FINISHED、FAILED 和 KILLED。默认为:RUNNING、ACCEPTED 和 SUBMITTED。多个状态使用英文逗号分隔。
显示运行中的 Spark 任务:
yarn application -list –appStates RUNNING --appTypes SPARK
显示应用状态:
yarn application -status <应用 ID>
杀掉任务:
yarn application -kill <应用 ID>
Node
集群节点相关命令。实现类: org.apache.hadoop.yarn.client.cli.NodeCLI
。
显示 NN 节点:
yarn node -list
显示挂掉的 NN 节点:
yarn node -list -states LOST
选项 states
节点状态包括:NEW、RUNNING、 UNHEALTHY、DECOMMISSIONED、LOST 和 REBOOTED。
Logs
应用日志相关命令。实现类: org.apache.hadoop.yarn.client.cli.LogsCLI
。
使用该功能需要开启日志聚合,编辑 yarn-site.xml 文件,设置 yarn.log-aggregation-enable
值为 true
。
查看应用日志:
yarn logs -applicationId <应用 ID>
参考
Recommend
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK