yarn命令

yarn命令
根据状态查看Yarn全部运行应用程序
# 查看全部运行过的yarn程序
yarn application -list -appStates ALL
# 查看正在运行的yarn程序,等同于:yarn application -list
yarn application -list -appStates RUNNING
1
2
3
4
-appStates

与-list一起使用,可根据输入的逗号分隔的应用程序状态列表来过滤应用程序。有效的应用程序状态可以是以下之一:ALL,NEW,NEW_SAVING,SUBMITTED,ACCEPTED,RUNNING,FINISHED,FAILED,KILLED

根据提交程序代码提交类型查看运行程序
# 查看Flink提交到yarn的程序
# yarn application -list -appTypes 'Apache Flink'

Application-Id        Application-Name        Application-Type          User         Queue                 State           Final-State           Progress                           Tracking-URL
application_1651044751782_0093    avris-profile-platform            Apache Flink          hdfs    root.users.hdfs               RUNNING             UNDEFINED               100%         http://dev-bigdata-24-149:4681

1
2
3
4
5
6
-appTypes #与-list一起使用,可以根据输入的逗号分隔的应用程序类型列表来过滤应用程序。

yarn top 查看正在运行的状态
YARN top - 17:03:12, up 13d, 6:24, 0 active users, queue(s): root
NodeManager(s): 3 total, 3 active, 0 unhealthy, 0 decommissioned, 0 lost, 0 rebooted
Queue(s) Applications: 7 running, 119 submitted, 0 pending, 69 completed, 43 killed, 0 failed
Queue(s) Mem(GB): 16 available, 70 allocated, 0 pending, 0 reserved
Queue(s) VCores: 67 available, 29 allocated, 0 pending, 0 reserved
Queue(s) Containers: 29 allocated, 0 pending, 0 reserved

                  APPLICATIONID USER             TYPE      QUEUE PRIOR   #CONT  #RCONT  VCORES RVCORES     MEM    RMEM  VCORESECS    MEMSECS %PROGR       TIME NAME                                            
 application_1655951936605_0067 hadoop     apache flink    default     0       9       0       9       0     26G      0G    1636659    4728125 100.00   02:02:31 avris-clue-rule
 application_1655951936605_0120 hadoop     apache flink    default     0       6       0       6       0     12G      0G     509589    1019188 100.00   00:23:35 avris-profile-platform
 application_1655951936605_0122 hadoop     apache flink    default     0       4       0       4       0     11G      0G       4945      13599 100.00   00:00:20 avris-strategy-rule
 application_1655951936605_0048 hadoop     apache flink    default     0       3       0       3       0      9G      0G    1287268    3861784 100.00   04:23:11 avris-scEvent-toCDP
 application_1655951936605_0121 hadoop     apache flink    default     0       3       0       3       0      5G      0G     253043     421733 100.00   00:23:25 avris-behavior-labelRegine
 application_1655951936605_0003 hadoop     apache flink    default     0       2       0       2       0      3G      0G    2290410    3435610 100.00   13:06:06 avris-userinfo-change
 application_1655951936605_0002 hadoop     apache flink    default     0       2       0       2       0      4G      0G    2290768    4581525 100.00   13:06:09 avris-event-hbase
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
说明:

参数    说明
#RCONT    使用的容器container个数
RVCORES    使用的cpu核数
RMEM    使用的内存大小
APPLICATIONID    yarn任务ID
USER    提交任务用户
TYPE    任务类型,如:apache flink
QUEUE    提交任务所在队列
yarn top整体资源使用查看
YARN top - 17:08:52, up 13d, 6:29, 0 active users, queue(s): root
NodeManager(s): 3 total, 3 active, 0 unhealthy, 0 decommissioned, 0 lost, 0 rebooted
Queue(s) Applications: 7 running, 119 submitted, 0 pending, 69 completed, 43 killed, 0 failed
Queue(s) Mem(GB): 16 available, 70 allocated, 0 pending, 0 reserved
Queue(s) VCores: 67 available, 29 allocated, 0 pending, 0 reserved
Queue(s) Containers: 29 allocated, 0 pending, 0 reserved
1
2
3
4
5
6
参数    说明
available    剩余可用的资源
allocated    已经使用的资源
reserved    已经申请正在分配的资源
pending    等待申请的资源
available + allocated    Yarn的总资源
Yarn web页面


工具脚本
根据yarn应用名称kill进程
[hadoop@10 /data]$ cat kill.sh 
applicationId=`yarn application -list | grep '提交程序在Yarn名称' |awk '{print $1}'`
yarn application -kill $applicationId
yarn application -list
1
2
3
4
根据yarn应用名称查看日志
applicationId=`yarn application -list | grep '提交程序在Yarn名称' |awk '{print $1}'`
yarn logs -applicationId $applicationId
1
2

————————————————
版权声明:本文为CSDN博主「jast_zsh」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/zhangshenghang/article/details/125643979

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值