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

页面端查看

相关推荐
网络与设备以及操作系统学习使用者28 分钟前
零信任架构落地实践详解
运维·网络·学习·架构
满天星830357731 分钟前
【Git】原理及使用(三)(分支管理)
linux·git
weixin_4684668539 分钟前
Prometheus监控服务部署与实战指南
服务器·后端·python·docker·自动化·prometheus
载数而行52039 分钟前
Linux 2 基本实操(远程操控,远程传输,vi/vim编辑器,关机重启,xshell的用户登录注销)
linux
me8321 小时前
【Linux】Linux 目录命名规范溯源(Linux各个目录究竟是干嘛的)
linux·运维·数据库
lolo大魔王1 小时前
Linux 内置命令与外部命令超详解(区别、原理、查找、执行流程)
linux·运维·服务器
H Journey1 小时前
Linux 查看进程端口占用命令整理
linux·运维·服务器
着迷不白1 小时前
二、Linux命令3要素及系统结构+文件的增删改查
linux·运维·服务器
heimeiyingwang1 小时前
【架构实战】搜索系统架构设计:从精准匹配到智能推荐
运维·架构·jenkins
zzzyyy5381 小时前
System V IPC 全链路深度解析 —— 从信号量原子性到内核多态再到物理内存共享
linux·服务器