Hadoop3:Yarn常用Shell命令

一、查看任务

1、查看所有任务

bash 复制代码
yarn application -list

2、根据状态查看任务

语法

bash 复制代码
yarn application -list -appStates (所有状态:ALL、NEW、NEW_SAVING、SUBMITTED、ACCEPTED、RUNNING、FINISHED、FAILED、KILLED)

例如

bash 复制代码
yarn application -list -appStates FINISHED

3、Kill掉Application

根据appid kill任务

bash 复制代码
yarn application -kill application_1719625561008_0003

二、查看日志

1、查询Application日志

语法

bash 复制代码
yarn logs -applicationId <ApplicationId>

案例

bash 复制代码
yarn logs -applicationId application_1719625561008_0003

2、查询Container日志

语法

bash 复制代码
yarn logs -applicationId <ApplicationId> -containerId <ContainerId>

案例

bash 复制代码
yarn logs -applicationId application_1719625561008_0003 -containerId container_1719625561008_0003_01_000001

三、查看尝试运行的任务

1、列出所有Application尝试的列表

语法

bash 复制代码
yarn applicationattempt -list <ApplicationId>

案例

bash 复制代码
yarn applicationattempt -list application_1719625561008_0003

这里我们可以查看到ContainerIdApplicationAttemptId

2、打印ApplicationAttemp状态

语法

bash 复制代码
yarn applicationattempt -status <ApplicationAttemptId>

案例

bash 复制代码
yarn applicationattempt -status appattempt_1719625561008_0003_000001

四、查看容器

1、列出所有Container

语法

bash 复制代码
yarn container -list <ApplicationAttemptId>

案例1(运行完的任务)
容器只有在任务运行的时候,才能查看到
运行结束的任务,是查看不到对应的容器的

bash 复制代码
yarn container -list appattempt_1719625561008_0003_000001

案例2(运行中的任务)

bash 复制代码
yarn container -list appattempt_1719625561008_0004_000001

2、查看Container状态

语法

bash 复制代码
yarn container -status <ContainerId>

案例

bash 复制代码
yarn container -status container_1719625561008_0003_01_000001

五、查看节点状态

1、列出所有节点

案例

bash 复制代码
yarn node -list -all

六、重新加载Yarn配置

1、更新Yarn队列相关配置

修改配置后,直接执行该命令,就可以加载最新配置,无需重启Yarn服务

对应配置文件:capacity-scheduler.xml

bash 复制代码
yarn rmadmin -refreshQueues

七、查看队列

1、查看队列状态

语法

bash 复制代码
yarn queue -status <QueueName>

案例

bash 复制代码
yarn queue -status default

页面端查看

相关推荐
zkmall2 分钟前
企业电商解决方案哪家好?ZKmall模块商城全渠道支持 + 定制化服务更省心
大数据·运维·重构·架构·开源
云资源服务商2 小时前
解锁阿里云日志服务SLS:云时代的日志管理利器
服务器·阿里云·云计算
绝不偷吃2 小时前
ELK日志分析系统
运维·elk·jenkins
朱包林3 小时前
day45-nginx复杂跳转与https
linux·运维·服务器·网络·云计算
孙克旭_3 小时前
day045-nginx跳转功能补充与https
linux·运维·nginx·https
孞㐑¥4 小时前
Linux之Socket 编程 UDP
linux·服务器·c++·经验分享·笔记·网络协议·udp
Hacker_Oldv5 小时前
软件测试(功能、工具、接口、性能、自动化、测开)详解
运维·自动化
Java樱木5 小时前
使用字节Trae + MCP,UI 到网页自动化。
运维·自动化
柳鲲鹏6 小时前
WINDOWS最快布署WEB服务器:apache2
服务器·前端·windows
无敌暴龙兽z8 小时前
离线环境安装elk及设置密码认证
运维·elk