首页 > 其他分享 >Yarn 常用命令

Yarn 常用命令

时间:2023-01-03 21:33:58浏览次数:59  
标签:container ranan list hadoop yarn application Yarn 常用命令

Yarn 常用命令(开发重点)

Yarn状态的查询,除了可以在hadoop103:8088页面查看外,还可以通过命令操作

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

//启动集群命令
[ranan@hadoop102 ~]$ myhadoop.sh start

//执行命令,执行前打开hadoop103:8088查看任务运行情况
[ranan@hadoop102 hadoop-3.1.3]$ hadoop jar share/hadoop/mapreduce/hadoop-mapreduce-examples-3.1.3.jar wordcount /input /output

image

查看任务 yarn application

列出正在执行的所有任务 yarn application -list

只会显示正在执行的任务

[ranan@hadoop102 ~]$ yarn application -list

image

根据Application状态过滤 yarn application -list -appSates 状态

命令:yarn application -list -appSates ALL|NEW|NEW_SAVING|SUBMITTED|ACCEPTED|RUNNING(正在运行的任务)|FINISHED(结束)|FAILED|KILLED

[ranan@hadoop102 hadoop-3.1.3]$ yarn application -list -appStates FINISHED

image

Kill掉Application yarn application -kill 任务名

命令:yarn application -kill 任务名

[ranan@hadoop102 hadoop-3.1.3]$ yarn application -kill application_1635339568216_0002

查看日志 yarn logs

查询Application日志 yarn logs -applicationId applicationId

命令:yarn logs -applicationId applicationId
查看运行时的日志,可以查看错误信息

[ranan@hadoop102 hadoop-3.1.3]$ yarn logs -applicationId application_1635339568216_0002

查看Container日志 yarn logs -applicationId applicationId -containerId containerId

命令:yarn logs -applicationId applicationId -containerId containerId

说明:查看任务下的某一个容器的运行情况

应用场景:一个Application会分成几个Task执行,每个task外面都包裹了一次container,当任务发生异常时通过查看cantainer的日志分析该task的是否异常。

[ranan@hadoop102 hadoop-3.1.3]$ yarn logs -applicationId application_1635339568216_0002 -containerId container_1635339568216_0002_01_000001

查看尝试运行的任务 yarn applicationattempt

尝试:任务正在运行时的状态

列出所有尝试运行的Application列表 yarn applicationattempt -list ApplicationId

命令: yarn applicationattempt -list ApplicationId

说明:任务在运行时的状态

[ranan@hadoop102 hadoop-3.1.3]$yarn applicationattempt -list application_1635339568216_0002

image

打印 ApplicationAttemp 状态 yarn applicationattempt -status ApplicationAttemptId

执行命令的时刻处于什么状态

命令:yarn applicationattempt -status ApplicationAttemptId

[ranan@hadoop102 hadoop-3.1.3]$ yarn applicationattempt -status appattempt_1635339568216_0002_000001

image

查看容器 yarn container

只有在任务运行的途中才能看到container的状态

列出所有的容器 yarn container -list ApplicationAttemptId

命令:yarn container -list ApplicationAttemptId

说明:当前时刻有多少container容器,容器只能在运行时查看到,运行完毕就释放。常用于异常情况时查看。

[ranan@hadoop102 hadoop-3.1.3]$ yarn container -list appattempt_1635339568216_0002_000001

打印Container状态 yarn container -status ContainerId

命令:yarn container -status container_1635339568216_0002_01_000001

查看节点状态 yarn node

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

命令:yarn node -list -all
说明:查看nodeManager的状态

[ranan@hadoop102 hadoop-3.1.3]$yarn node -list -all

image

更新配置 yarn rmadmin

刷新队列配置 yarn rmadmin -refreshOueues

命令:yarn rmadmin -refreshOueues

查看队列 yarn queue

容量调度器和公平调度器都有默认队列default

打印队列信息 yarn queue -status QueueName

image

标签:container,ranan,list,hadoop,yarn,application,Yarn,常用命令
From: https://www.cnblogs.com/augusite/p/17023422.html

相关文章

  • redis常用命令之Hash
    redis常用命令之HashHash常用命令redis可以理解为一个全局的大字典,key就是数据的唯一标识符。对应的key不同,value也不同。redis有5个基本的数据类型。1redis={2......
  • yarn.ps1 cannot be loaded error解决办法
    yarn:FileC:\Users\jeff.han\AppData\Roaming\npm\yarn.ps1cannotbeloaded.ThefileC:\Users\jeff.han\AppData\Roaming\npm\yarn.ps1isnotdigitallysigned.Y......
  • yarn 报错There appears to be trouble with your network connection. Retrying
    在jenkins执行构建前端项目镜像使用yarn的时候报错,如下图:   yarn错误Thereappearstobetroublewithyournetworkconnection.Retrying…原因:yarn超时#doc......
  • Kafka常用命令
    1.查看topic列表./kafka-topics.sh--zookeeperlocalhost:2181--list2.创建一个名为test的topic./kafka-topics.sh--create--zookeeperlocalhost:2181--replicati......
  • kafka常用命令(zookeeper与bootstrap-server)
       在0.9.0.0之后的Kafka,出现了几个新变动,一个是在Server端增加了GroupCoordinator这个角色,另一个较大的变动是将topic的offset信息由之前存储在zookeeper......
  • Kubernetes(k8s) kubectl annotate常用命令
    kubectl在$HOME/.kube目录中查找一个名为config的配置文件。可以通过设置KUBECONFIG环境变量或设置--kubeconfig参数来指定其它kubeconfig文件。本文主要介绍K......
  • Linux常用命令
    Linux常用命令 1.cd切换目录菜单~切换到家目录cd/切换到根目录cd-切换到上一次操作的目录cd..或cd../切换到上级目录cd.或cd./切换......
  • Ubuntu 常用命令
    Usingubuntuwhichrails\\查找路径;pwd\\当前目录;sudosu\\切换到管理员;sudomount-tvboxsfsarah/mnt/s......
  • Kubernetes(k8s) kubectl convert常用命令
    kubectl在$HOME/.kube目录中查找一个名为config的配置文件。可以通过设置KUBECONFIG环境变量或设置--kubeconfig参数来指定其它kubeconfig文件。本文主要介绍K......
  • Docker容器之——Docker常用命令
    1.docker帮助命令dockerversion#显示docker版本信息dockerinfo#显示docker信息系统,包括镜像和容器数量docker--help#docker帮助命令2.docker镜像命令docke......