• Hadoop3:Yarn常用Shell命令


    一、查看任务

    1、查看所有任务

    yarn application -list
    

    在这里插入图片描述

    2、根据状态查看任务

    语法

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

    例如

    yarn application -list -appStates FINISHED
    

    在这里插入图片描述

    3、Kill掉Application

    根据appid kill任务

    yarn application -kill application_1719625561008_0003
    

    在这里插入图片描述

    二、查看日志

    1、查询Application日志

    语法

    yarn logs -applicationId <ApplicationId>
    

    案例

    yarn logs -applicationId application_1719625561008_0003
    

    2、查询Container日志

    语法

    yarn logs -applicationId <ApplicationId> -containerId <ContainerId>
    

    案例

    yarn logs -applicationId application_1719625561008_0003 -containerId container_1719625561008_0003_01_000001
    

    在这里插入图片描述

    三、查看尝试运行的任务

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

    语法

    yarn applicationattempt -list <ApplicationId>
    

    案例

    yarn applicationattempt -list application_1719625561008_0003
    

    这里我们可以查看到ContainerIdApplicationAttemptId
    在这里插入图片描述

    2、打印ApplicationAttemp状态

    语法

    yarn applicationattempt -status <ApplicationAttemptId>
    

    案例

    yarn applicationattempt -status appattempt_1719625561008_0003_000001
    

    在这里插入图片描述

    四、查看容器

    1、列出所有Container

    语法

    yarn container -list <ApplicationAttemptId>
    

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

    yarn container -list appattempt_1719625561008_0003_000001
    

    在这里插入图片描述
    案例2(运行中的任务)

    yarn container -list appattempt_1719625561008_0004_000001
    

    在这里插入图片描述

    2、查看Container状态

    语法

    yarn container -status <ContainerId>
    

    案例

    yarn container -status container_1719625561008_0003_01_000001
    

    在这里插入图片描述

    五、查看节点状态

    1、列出所有节点

    案例

    yarn node -list -all
    

    在这里插入图片描述

    六、重新加载Yarn配置

    1、更新Yarn队列相关配置

    修改配置后,直接执行该命令,就可以加载最新配置,无需重启Yarn服务
    对应配置文件:capacity-scheduler.xml

    yarn rmadmin -refreshQueues
    

    在这里插入图片描述

    七、查看队列

    1、查看队列状态

    语法

    yarn queue -status <QueueName>
    

    案例

    yarn queue -status default
    

    在这里插入图片描述
    页面端查看
    在这里插入图片描述

  • 相关阅读:
    Redis缓存击穿及解决问题
    linux安装kafka
    ubuntu开机系统出错且无法恢复。请联系系统管理员。
    竞赛选题 深度学习二维码识别
    李宏毅 2022机器学习 HW3 boss baseline 上分记录
    超级简单快速上手Vue
    【视觉算法系列1】使用 KerasCV YOLOv8 进行红绿灯检测(下)
    Allegro 172版本自动放置层叠
    Git 简介及使用
    Qt学习27 应用程序中的主窗口
  • 原文地址:https://blog.csdn.net/Brave_heart4pzj/article/details/140059261