0
点赞
收藏
分享

微信扫一扫

Hadoop(24):Yarn的常用命令

知年_7740 2022-05-05 阅读 99

目录

0. 相关文章链接

1. 什么是YARN的常用命令

2. yarn application查看任务

3. yarn logs查看日志

4. yarn applicationattempt查看尝试运行的任务

5. yarn container查看容器

6. yarn node查看节点状态

7. yarn rmadmin更新配置

8. yarn queue查看队列


0. 相关文章链接

Hadoop 文章汇总

1. 什么是YARN的常用命令

Yarn状态的查询,除了可以在bigdata1:8088页面查看外,还可以通过命令操作。在执行这些命令的前提是需要有程序在YARN上运行,此次演示程序为执行WordCount案例,并用Yarn命令查看任务运行情况。

启动官方WordCount案例如下命令所示:

hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.3.jar wordcount /input /output

2. yarn application查看任务

1)列出所有Application:

2)根据Application状态过滤:yarn application -list -appStates (所有状态:ALL、NEW、NEW_SAVING、SUBMITTED、ACCEPTED、RUNNING、FINISHED、FAILED、KILLED)

3)Kill掉Application:

3. yarn logs查看日志

1)查询Application日志:yarn logs -applicationId <ApplicationId>

2)查询Container日志:yarn logs -applicationId <ApplicationId> -containerId <ContainerId> 

4. yarn applicationattempt查看尝试运行的任务

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

2)打印ApplicationAttemp状态:yarn applicationattempt -status <ApplicationAttemptId>

5. yarn container查看容器

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

2)打印Container状态:    yarn container -status <ContainerId>

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

6. yarn node查看节点状态

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

7. yarn rmadmin更新配置

加载队列配置:yarn rmadmin -refreshQueues

8. yarn queue查看队列

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


注:其他Hadoop相关系列文章链接由此进 -> Hadoop 文章汇总


举报

相关推荐

0 条评论