简体   繁体   English

运行多个 flink 作业的问题(在 Flink 集群上)

[英]Issue running multiple flink jobs (on Flink Cluster)

Folks,各位,

We have few flink jobs - built as separate executable Jars我们几乎没有 flink 作业 - 构建为单独的可执行 Jars

Each of this flink jobs is using the following to run -每个 flink 作业都使用以下内容来运行 -

>  StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
> 
> try {
>             env.execute("FLINK-JOB");
>         } catch (Exception ex) {
>             // Some message
>         }

But when we deploy these Flink jobs (5 in all) - only one runs and the other one closes.但是当我们部署这些 Flink 作业(总共 5 个)时 - 只有一个运行,另一个关闭。

the way we deploy is via bin/flink run我们部署的方式是通过 bin/flink run

Thanks Much非常感谢

I guess you may be using the default startup method of flink standalone, via bin/start-cluster.sh and bin/stop-cluster.sh .我猜您可能正在使用 flink Standalone 的默认启动方法,通过bin/start-cluster.shbin/stop-cluster.sh this method is rely on conf/masters and conf/workers to determine the number of cluster component instances, the default number of taskmanager only 1, with 1 slot.这种方法是依靠conf/mastersconf/workers来确定集群组件实例的数量,默认taskmanager的数量只有1个,有1个slot。

When the job parallelism is only one, only one job can be run (when the job parallelism is greater than one, no job can run).当作业并行度只有一个时,只能运行一个作业(当作业并行度大于一时,不能运行任何作业)。 When you do not have enough taskmanager (slot), you cannot run enough jobs (each job needs at least one slot)当你没有足够的 taskmanager(slot)时,你无法运行足够多的作业(每个作业至少需要一个 slot)

you can add taskmanager (slot) by referring to the steps on the picture可以参考图片上的步骤添加taskmanager(slot)

flink document link flink 文档链接

This might be because you are using same job name in env.execute("FLINK-JOB").这可能是因为您在 env.execute("FLINK-JOB") 中使用了相同的作业名称。 Please try to make it different for 5 of your jobs, alternatively, you can pass job name using parameter configuration while deploying flink job and pass different job name using env.execute(params.get("your-job-name")).请尝试为您的 5 个作业设置不同,或者,您可以在部署 flink 作业时使用参数配置传递作业名称,并使用 env.execute(params.get("your-job-name")) 传递不同的作业名称。 Having unique job name should be helpful.拥有唯一的工作名称应该会有所帮助。 Thanks谢谢

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

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