为什么 stop-cluster.sh 停止最新启动的 Flink 集群? [英] why the stop-cluster.sh stop the latest started Flink cluster?

查看:64
本文介绍了为什么 stop-cluster.sh 停止最新启动的 Flink 集群?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我打算从 Flink 1.5.2 升级到 1.6.0,然后进行作业迁移.为了尽量减少作业的暂停时间,我计划同时运行两个 Flink 集群,在迁移作业成功后,我会停止旧的.但是,当我尝试通过在 Flink1.5.2/bin 目录中运行 stop-cluster.sh 来停止 Flink 集群时,我发现停止的集群是 Flink 1.6.0 而不是预期的 Flink 1.5.2.

I'm plan to do an upgrading from Flink 1.5.2 to 1.6.0, and then do the jobs migration. In order to minimum the pause time for the jobs, I plan to run both Flink clusters at the same time, after migrating jobs successfully, I would stop the old one. However when I tried to stop the Flink cluster by running stop-cluster.sh in the directory Flink1.5.2/bin , I found the stopped cluster is Flink 1.6.0 instead of the expected Flink 1.5.2 .

我做了一些测试,发现stop-cluster.sh只是停止最新启动的Flink集群,也就是说,如果你先启动集群1.6.0,然后启动Flink 1.5.2,然后运行stop-cluster.sh,即使你在集群1.6.0目录Flink1.6.0/bin下运行stop-cluster.sh,它也会首先停止Flink 1.5.2.根据我的理解,在 Flink1.6.0/bin 运行 stop-cluster.sh 时应该停止集群 1.6.0,并在 Flink1.5.2/bin 运行 stop-cluster.sh 时停止集群 1.5.2,但它没有.

I did some test and found the stop-cluster.sh just stop the latest started Flink cluster, that is to say, if you start cluster 1.6.0 firstly, then starts Flink 1.5.2, after that when you run stop-cluster.sh, it would stop Flink 1.5.2 firstly even you run the stop-cluster.sh at the cluster 1.6.0 directory Flink1.6.0/bin. Based on my understanding, when running the stop-cluster.sh at the Flink1.6.0/bin it should stop cluster 1.6.0, and stop the cluster 1.5.2 when running the stop-cluster.sh at the Flink1.5.2/bin , however it didn't.

我做了一些研究,发现 stop-cluster.sh 会根据包含 pid 的文件终止进程,但是我不知道该文件的位置,我怀疑两个集群都写了 pid在它们开始时的相同位置,这使得 stop-cluster.sh 变得混乱.

I did some research and found the stop-cluster.sh would kill the process based on the file which contains the pid , however I don't know the location of that file, and I suspect both of the clusters write the pid in the same places when they started, which make the stop-cluster.sh chaotic.

请告知如何停止指定的集群.

Please advise how to stop the specified cluster.

推荐答案

默认情况下,pid 文件被写入 /tmp 并具有名称 flink-<USER>-<FLINK_COMPONENT>.pid.您可以通过在flink-conf.yaml 中设置env.pid.dir 配置来控制目录.通过使用不同的 pid 文件目录,您可以控制不同的集群.

Per default, the pid file is written to /tmp and has the name flink-<USER>-<FLINK_COMPONENT>.pid. You can control the directory by setting the env.pid.dir configuration in flink-conf.yaml. By using different pid file directory you can keep control over the different clusters.

这篇关于为什么 stop-cluster.sh 停止最新启动的 Flink 集群?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆