【大数据】Hadoop-Yarn常用运维命令使用

查看任务

列出所有Application

yarn application -list

根据Application状态过滤

yarn application -list -appStates

Kill掉Application

yarn application -kill <ApplicationId>

查看集群负载和资源情况

使用yarn top命令查看,和linux的top类似

yarn top
NodeManager(s): 3 total, 3 active, 0 unhealthy, 0 decommissioned, 0 lost, 0 rebooted
Queue(s) Applications: 1 running, 33 submitted, 0 pending, 31 completed, 0 killed, 1 failed
Queue(s) Mem(GB): 17 available, 6 allocated, 0 pending, 0 reserved
Queue(s) VCores: 21 available, 2 allocated, 0 pending, 0 reserved
Queue(s) Containers: 2 allocated, 0 pending, 0 reserved


 application_1676450522732_0035 root            spark    default     0       2       0       2       0      6G      0G         76        232  10.00   00:00:00 org.ap

yarn logs查看日志

查询Application日志

yarn logs -applicationId <ApplicationId>

查看am日志

bin/yarn logs -am [1,2] -applicationId <ApplicationId>

yarn applicationattempt查看尝试运行的任务

yarn applicationattempt -list <ApplicationId>

打印ApplicationAttemp状态

yarn applicationattempt -status <ApplicationAttemptId>

yarn container查看容器

列出所有Container

yarn container -list <ApplicationAttemptId>

打印Container状态

只有在任务跑的途中才能看到container的状态

yarn container -status <ContainerId>

yarn node查看节点状态

列出所有节点

yarn node -list -all

yarn rmadmin更新配置

加载队列配置

yarn rmadmin -refreshQueues

yarn queue查看队列

打印队列信息

yarn queue -status <QueueName>

希望对正在查看文章的您有所帮助,记得关注、评论、收藏,谢谢您

猜你喜欢

转载自blog.csdn.net/u013412066/article/details/129472118