简体   繁体   English

Apache Flink:未应用环境并行设置

[英]Apache Flink: Environment Parallelism Setting not applied

I'm trying to set an overall parallelism setting in Flink 1.8.3 in Java as per documentation :我正在尝试按照文档在 Java 中的 Flink 1.8.3 中设置整体并行度设置:

StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
env.setParallelism(4);

Aside from that, I have also setParallelism(2) calls on the sink and source.除此之外,我还在接收器和源上调用了setParallelism(2)

I also can see in the flink UI that the environment setting is applied (long-running session cluster, job submitted via rest API or Flink UI):我还可以在 flink UI 中看到应用了环境设置(长时间运行的 session 集群,通过 rest API 或 Flink UI 提交的作业):

flink 作业配置

but when i have a look at the parallelism the individual stages are running in the Flink UI, they run all with parallelism 1 (aside from source and sink, which are running with the expected parallelism setting):但是当我查看各个阶段在 Flink UI 中运行的并行度时,它们都以并行度 1 运行(除了源和接收器,它们以预期的并行度设置运行):

flink 作业并行度 UI

I already tried also setting the parallelism setting on the individual operators instead, but it did not change anything.我已经尝试过在各个运算符上设置并行度设置,但它没有改变任何东西。 the operators are normal flatmaps and filters.运算符是普通的平面图和过滤器。

What is not configured right here to have all operators respect the parallelism setting properly?这里没有配置什么让所有操作员都正确尊重并行设置? Can't i assume that setting the environment level parallelism will automatically apply this to all operators?我不能假设设置环境级别的并行性会自动将其应用于所有操作员吗? Ie do I need to watch out for other stuff as well when setting parallelism setting?即在设置并行度设置时我是否还需要注意其他东西?

I "fixed" it by not trying to change the parallelism setting from inside the flink job code, but by passing a parallelism setting when starting the Flink job.我通过不尝试从 flink 作业代码内部更改并行度设置,而是通过在启动 Flink 作业时传递并行度设置来“修复”它。 this is not only possible via the CLI, but also via Rest API and the Flink UI.这不仅可以通过 CLI 实现,还可以通过 Rest API 和 Flink UI 实现。 Everything works for us now as expected.现在一切都按预期对我们有用。

I also faced an similar issue recently, i had an problem with taskmanager.numberOfTaskSlots .我最近也遇到了类似的问题,我遇到了taskmanager.numberOfTaskSlots的问题。 Make sure that your taskmanager has enough slots available.确保您的任务管理器有足够的可用插槽。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM