zoukankan      html  css  js  c++  java
  • HADOOP YARN(2):YARN资源调度器(2)入门

    5 Yarn常用命令

    Yarn状态的查询,除了可以在hadoop103:8088页面查看外,还可以通过命令操作。常见的命令操作如下所示:

    需求:执行WordCount案例,并用Yarn命令查看任务运行情况。

    [atguigu@hadoop102 hadoop-3.1.3]$ myhadoop.sh start
    
    [atguigu@hadoop102 hadoop-3.1.3]$ hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.3.jar wordcount /input /output

    5.1 yarn application查看任务

    1列出所有Application:

    [atguigu@hadoop102 hadoop-3.1.3]$ yarn application -list
    2021-02-06 10:21:19,238 INFO client.RMProxy: Connecting to ResourceManager at hadoop103/192.168.10.103:8032
    Total number of applications (application-types: [], states: [SUBMITTED, ACCEPTED, RUNNING] and tags: []):0
                    Application-Id        Application-Name        Application-Type          User         Queue                 State           Final-State           Progress                           Tracking-URL

    2根据Application状态过滤:yarn application -list -appStates (所有状态:ALLNEWNEW_SAVINGSUBMITTEDACCEPTEDRUNNINGFINISHEDFAILEDKILLED

    [atguigu@hadoop102 hadoop-3.1.3]$ yarn application -list -appStates FINISHED
    2021-02-06 10:22:20,029 INFO client.RMProxy: Connecting to ResourceManager at hadoop103/192.168.10.103:8032
    Total number of applications (application-types: [], states: [FINISHED] and tags: []):1
                    Application-Id        Application-Name        Application-Type          User         Queue                 State           Final-State           Progress                           Tracking-URL
    application_1612577921195_0001              word count               MAPREDUCE       atguigu       default              FINISHED             SUCCEEDED               100%    http://hadoop102:19888/jobhistory/job/job_1612577921195_0001

    3KillApplication

    [atguigu@hadoop102 hadoop-3.1.3]$ yarn application -kill application_1612577921195_0001
    2021-02-06 10:23:48,530 INFO client.RMProxy: Connecting to ResourceManager at hadoop103/192.168.10.103:8032
    Application application_1612577921195_0001 has already finished

    5.2 yarn logs查看日志

    5.3 yarn applicationattempt查看尝试运行的任务

    1列出所有Application尝试的列表:yarn applicationattempt -list <ApplicationId>

    5.4 yarn container查看容器

    1列出所有Container:yarn container -list <ApplicationAttemptId>

    [atguigu@hadoop102 hadoop-3.1.3]$ yarn container -list appattempt_1612577921195_0001_000001
    2021-02-06 10:28:41,396 INFO client.RMProxy: Connecting to ResourceManager at hadoop103/192.168.10.103:8032
    Total number of containers :0
                      Container-Id              Start Time             Finish Time                   State                    Host       Node Http Address    

    5.5 yarn node查看节点状态

    列出所有节点:yarn node -list -all

    5.6 yarn rmadmin更新配置

    加载队列配置:yarn rmadmin -refreshQueues

    [atguigu@hadoop102 hadoop-3.1.3]$ yarn rmadmin -refreshQueues
    2021-02-06 10:32:03,331 INFO client.RMProxy: Connecting to ResourceManager at hadoop103/192.168.10.103:8033

    5.7 yarn queue查看队列

    打印队列信息:yarn queue -status <QueueName>

    [atguigu@hadoop102 hadoop-3.1.3]$ yarn queue -status default
    2021-02-06 10:32:33,403 INFO client.RMProxy: Connecting to ResourceManager at hadoop103/192.168.10.103:8032
    Queue Information : 
    Queue Name : default
        State : RUNNING
        Capacity : 100.0%
        Current Capacity : .0%
        Maximum Capacity : 100.0%
        Default Node Label expression : <DEFAULT_PARTITION>
        Accessible Node Labels : *
        Preemption : disabled
        Intra-queue Preemption : disabled

    6 Yarn生产环境核心参数

    本文来自博客园,作者:秋华,转载请注明原文链接:https://www.cnblogs.com/qiu-hua/p/15229160.html

  • 相关阅读:
    python 安装第三方插件库报错的解决方案
    vue.js helloword
    node.js HelloWord
    十一 —— 迭代器、生成器、装饰器
    十、函数——匿名函数、推导式
    九、函数 —— 参数
    八、数据类型——bytes类型+set类型
    七、数据类型 —— 字典
    六、数据类型 —— 字符串
    五、数据类型 —— 元组
  • 原文地址:https://www.cnblogs.com/qiu-hua/p/15229160.html
Copyright © 2011-2022 走看看