首页 \ 问答 \ 在YARN上运行时,Spark调度程序池如何工作?(How do Spark scheduler pools work when running on YARN?)

在YARN上运行时,Spark调度程序池如何工作?(How do Spark scheduler pools work when running on YARN?)

我在YARN(Hadoop 2.6.0 / CDH 5.5)上部署了各种Spark版本(1.6,2.0,2.1)。 我试图保证某个应用程序永远不会在我们的YARN集群上缺乏资源,无论在那里运行的是什么。

我启用了shuffle服务并设置了一些Fair Scheduler Pools ,如Spark文档中所述。 我为高优先级应用程序创建了一个单独的池,我希望永远不会缺乏资源,并给它一个minShare的资源共享:

<?xml version="1.0"?>
<allocations>
  <pool name="default">
    <schedulingMode>FAIR</schedulingMode>
    <weight>1</weight>
    <minShare>0</minShare>
  </pool>
  <pool name="high_priority">
    <schedulingMode>FAIR</schedulingMode>
    <weight>1</weight>
    <minShare>24</minShare>
  </pool>
</allocations>

当我在YARN集群上运行Spark应用程序时,我可以看到我配置的池被识别:

17/04/04 11:38:20 INFO scheduler.FairSchedulableBuilder: Created pool default, schedulingMode: FAIR, minShare: 0, weight: 1
17/04/04 11:38:20 INFO scheduler.FairSchedulableBuilder: Created pool high_priority, schedulingMode: FAIR, minShare: 24, weight: 1

但是,我没有看到我的应用程序正在使用新的high_priority池,即使我在调用spark-submit时设置了spark.scheduler.pool 。 这意味着当群集与常规活动挂钩时,我的高优先级应用程序无法获得所需的资源:

17/04/04 11:39:49 INFO cluster.YarnScheduler: Adding task set 0.0 with 1 tasks
17/04/04 11:39:50 INFO scheduler.FairSchedulableBuilder: Added task set TaskSet_0 tasks to pool default
17/04/04 11:39:50 INFO spark.ExecutorAllocationManager: Requesting 1 new executor because tasks are backlogged (new desired total will be 1)
17/04/04 11:40:05 WARN cluster.YarnScheduler: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources

我在这里想念的是什么? 我的同事和我试图在YARN中实现先发制人,但这没有做任何事情。 然后我们意识到YARN中的概念与称为YARN队列的 Spark调度程序池非常相似。 所以现在我们不确定这两个概念是否会以某种方式发生冲突。

我们如何让我们的高优先级池按预期工作? Spark调度程序池和YARN队列之间是否存在某种冲突?


I have a mix of Spark versions (1.6, 2.0, 2.1) all deployed on YARN (Hadoop 2.6.0 / CDH 5.5). I'm trying to guarantee that a certain application will never be starved of resources on our YARN cluster, regardless of what else may be running on there.

I've enabled the shuffle service and setup some Fair Scheduler Pools as described in the Spark docs. I created a separate pool for the high priority application I want never to be starved of resources, and gave it a minShare of resources:

<?xml version="1.0"?>
<allocations>
  <pool name="default">
    <schedulingMode>FAIR</schedulingMode>
    <weight>1</weight>
    <minShare>0</minShare>
  </pool>
  <pool name="high_priority">
    <schedulingMode>FAIR</schedulingMode>
    <weight>1</weight>
    <minShare>24</minShare>
  </pool>
</allocations>

When I run a Spark application on our YARN cluster, I can see that the pools I configured are recognized:

17/04/04 11:38:20 INFO scheduler.FairSchedulableBuilder: Created pool default, schedulingMode: FAIR, minShare: 0, weight: 1
17/04/04 11:38:20 INFO scheduler.FairSchedulableBuilder: Created pool high_priority, schedulingMode: FAIR, minShare: 24, weight: 1

However, I don't see that my application is using the new high_priority pool, even though I am setting spark.scheduler.pool in my call to spark-submit. So that means when the cluster is pegged by regular activity, my high priority application is not getting the resources it needs:

17/04/04 11:39:49 INFO cluster.YarnScheduler: Adding task set 0.0 with 1 tasks
17/04/04 11:39:50 INFO scheduler.FairSchedulableBuilder: Added task set TaskSet_0 tasks to pool default
17/04/04 11:39:50 INFO spark.ExecutorAllocationManager: Requesting 1 new executor because tasks are backlogged (new desired total will be 1)
17/04/04 11:40:05 WARN cluster.YarnScheduler: Initial job has not accepted any resources; check your cluster UI to ensure that workers are registered and have sufficient resources

What am I missing here? My coworkers and I tried enabling preemption in YARN, but that didn't do anything. And then we realized that there is a concept in YARN very similar to Spark scheduler pools called YARN queues. So now we're not sure if the two concepts conflict somehow.

How can we get our high priority pool to work as expected? Is there some kind of conflict between Spark scheduler pools and YARN queues?


原文:https://stackoverflow.com/questions/43239921
更新时间:2023-04-03 17:04

最满意答案

这应该是(假设你的字符串存储在' $string '中):

my ($var1, $var2) = $string =~ /_(\d+)_(\d+)/s; 

这个想法是抓住数字,直到你得到一个非数字字符:这里' _ '。

然后将每个捕获组分配给它们各自的变量。


正如在这个问题中提到的(以及Kaoru 下面的评论中):

\d确实可以匹配超过10个不同的字符,如果应用于Unicode字符串。

所以你可以使用:

my ($var1, $var2) = $string =~ /_([0-9]+)_([0-9]+)/s; 

That should be (assuming your string is stored in '$string'):

my ($var1, $var2) = $string =~ /_(\d+)_(\d+)/s; 

The idea is to grab numbers until you get a non-number character: here '_'.

Each capturing group is then assign to their respective variable.


As mentioned in this question (and in the comments below by Kaoru):

\d can indeed match more than 10 different characters, if applied to Unicode strings.

So you can use instead:

my ($var1, $var2) = $string =~ /_([0-9]+)_([0-9]+)/s; 

相关问答

更多

相关文章

更多

最新问答

更多
  • 获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
  • 如何通过引用返回对象?(How is returning an object by reference possible?)
  • 矩阵如何存储在内存中?(How are matrices stored in memory?)
  • 每个请求的Java新会话?(Java New Session For Each Request?)
  • css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
  • 无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
  • xcode语法颜色编码解释?(xcode syntax color coding explained?)
  • 在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
  • 从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
  • 从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
  • 西安哪有PLC可控制编程的培训
  • 在Entity Framework中选择基类(Select base class in Entity Framework)
  • 在Android中出现错误“数据集和渲染器应该不为null,并且应该具有相同数量的系列”(Error “Dataset and renderer should be not null and should have the same number of series” in Android)
  • 电脑二级VF有什么用
  • Datamapper Ruby如何添加Hook方法(Datamapper Ruby How to add Hook Method)
  • 金华英语角.
  • 手机软件如何制作
  • 用于Android webview中图像保存的上下文菜单(Context Menu for Image Saving in an Android webview)
  • 注意:未定义的偏移量:PHP(Notice: Undefined offset: PHP)
  • 如何读R中的大数据集[复制](How to read large dataset in R [duplicate])
  • Unity 5 Heighmap与地形宽度/地形长度的分辨率关系?(Unity 5 Heighmap Resolution relationship to terrain width / terrain length?)
  • 如何通知PipedOutputStream线程写入最后一个字节的PipedInputStream线程?(How to notify PipedInputStream thread that PipedOutputStream thread has written last byte?)
  • python的访问器方法有哪些
  • DeviceNetworkInformation:哪个是哪个?(DeviceNetworkInformation: Which is which?)
  • 在Ruby中对组合进行排序(Sorting a combination in Ruby)
  • 网站开发的流程?
  • 使用Zend Framework 2中的JOIN sql检索数据(Retrieve data using JOIN sql in Zend Framework 2)
  • 条带格式类型格式模式编号无法正常工作(Stripes format type format pattern number not working properly)
  • 透明度错误IE11(Transparency bug IE11)
  • linux的基本操作命令。。。