yarn 常用命令和生产环境核心参数

一、yarn 常用命令

1. 查看任务

#列出所有Application
yarn application -list

#查看对应状态的 Application
yarn application -list -appStates [ALL/NEW/NEW_SAVING/SUBMITTED/ACCEPTED/RUNNING/FINISHED/FAILED/KILLED]

#Kill Application
yarn application -kill [application_id]

2. 查看日志

#查看 application 日志
yarn logs -applicationId [application_id]

#查看 container 日志
yarn logs -applicationId [application_id] -containerId [container_id]

3. 查看尝试运行任务

#列出所有尝试运行的 Application
yarn applicationattempt -list [application_id]

#打印 ApplicationAttemp 状态
yarn applicationattempt -status [appattempt_id]

4. 查看容器

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

#打印Container状态,只有在任务跑的途中才能看到container的状态	
yarn container -status <ContainerId>

5. 查看节点状态

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

6. 查看队列

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

7. 更新配置

#加载队列配置
yarn rmadmin -refreshQueues

8. 设置队列优先级

yarn application -appID [application_id] -updatePriority 5

二、yarn 生产环境核心参数

1. ResourceManager 相关

  • yarn.resourcemanager.scheduler.class:配置调度器,默认容量调度器
  • yarn.resourcemanager.scheduler.client.thread-count:ResourceManager 处理调度器请求的线程数量,默认 50

2. NodeManager 相关

  • yarn.nodemanager.resource.detect-hardware-capabilities:是否让 yarn 自己检测硬件进行配置,默认 false
  • yarn.nodemanager.resource.count-logical-processors-as-cores:是否将虚拟核数当作 CPU 核数,默认 false
  • yarn.nodemanager.resource.pcores-vcores-multiplier:虚拟核数和物理核数乘数,例如:4核8线程,该参数就应设为 2,默认 1.0
  • yarn.nodemanager.resource.memory-mb:NodeManager 使用内存,默认8G
  • yarn.nodemanager.resource.system-reserved-memory-mb:NodeManager 为系统保留多少内存(和上一个参数二选一配即可)
  • yarn.nodemanager.resource.cpu-vcores:NodeManager 使用 CPU 核数,默认 8 个
  • yarn.nodemanager.pmem-check-enabled:是否开启物理内存检查限制 container,默认打开
  • yarn.nodemanager.vmem-check-enabled:是否开启虚拟内存检查限制 container,默认打开
  • yarn.nodemanager.vmem-pmem-ratio:虚拟内存物理内存比例,默认 2.1

3. Container 相关

  • yarn.scheduler.minimum-allocation-mb:容器最最小内存,默认 1G
  • yarn.scheduler.maximum-allocation-mb:容器最最大内存,默认 8G
  • yarn.scheduler.minimum-allocation-vcores:容器最小 CPU 核数,默认 1 个
  • yarn.scheduler.maximum-allocation-vcores:容器最大 CPU 核数,默认 4 个
  • 9
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 1
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值