flink:ha模式终止主jobmanager终止备用jobmanager

u3r8eeie  于 2021-06-25  发布在  Flink
关注(0)|答案(1)|浏览(398)

我试图让flink运行在ha模式下使用zookeeper,但当我试图通过杀死领队jobmanager来测试它时,我所有的备用jobmanager也会被杀死。
因此,他们都被杀了,而不是由一个待命的工作经理来接任新的领导,这是不应该发生的。
我的设置:4台服务器,其中3台运行zookeeper,但只有1台服务器将托管所有JobManager。

ad011.local: Zookeeper + Jobmanagers
ad012.local: Zookeeper + Taskmanager
ad013.local: Zookeeper
ad014.local: nothing interesting

我的masters文件如下所示:

ad011.local:8081
ad011.local:8082
ad011.local:8083

我的flink-conf.yaml:

jobmanager.rpc.address: ad011.local

blob.server.port: 6130,6131,6132

jobmanager.heap.mb: 512
taskmanager.heap.mb: 128
taskmanager.numberOfTaskSlots: 4
parallelism.default: 2
taskmanager.tmp.dirs: /var/flink/data

metrics.reporters: jmx
metrics.reporter.jmx.class: org.apache.flink.metrics.jmx.JMXReporter
metrics.reporter.jmx.port: 8789,8790,8791

high-availability: zookeeper
high-availability.zookeeper.quorum: ad011.local:2181,ad012.local:2181,ad013.local:2181

high-availability.zookeeper.path.root: /flink
high-availability.zookeeper.path.cluster-id: /cluster-one
high-availability.storageDir: /var/flink/recovery
high-availability.jobmanager.port: 50000,50001,50002

当我使用start-cluster.sh脚本运行flink时,我看到我的3个jobmanagers正在运行,它们都指向ad011。local:8081,这是领导者。我想这没关系吧?
然后,我尝试通过使用kill杀死领导者来测试故障转移,然后我的所有其他备用作业管理器也停止。
这是我在备用jobmanager日志中看到的:

2017-09-29 08:08:41,590 INFO  org.apache.flink.runtime.jobmanager.JobManager                - Starting JobManager at akka.tcp://flink@ad011.local:50002/user/jobmanager.
2017-09-29 08:08:41,590 INFO  org.apache.flink.runtime.leaderelection.ZooKeeperLeaderElectionService  - Starting ZooKeeperLeaderElectionService org.apache.flink.runtime.leaderelection.ZooKeeperLeaderElectionService@72d546c8.
2017-09-29 08:08:41,598 INFO  org.apache.flink.runtime.webmonitor.WebRuntimeMonitor         - Starting with JobManager akka.tcp://flink@ad011.local:50002/user/jobmanager on port 8083
2017-09-29 08:08:41,598 INFO  org.apache.flink.runtime.leaderretrieval.ZooKeeperLeaderRetrievalService  - Starting ZooKeeperLeaderRetrievalService.
2017-09-29 08:08:41,645 INFO  org.apache.flink.runtime.webmonitor.JobManagerRetriever       - New leader reachable under akka.tcp://flink@ad011.local:50000/user/jobmanager:f7dc2c48-dfa5-45a4-a63e-ff27be21363a.
2017-09-29 08:08:41,651 INFO  org.apache.flink.runtime.leaderretrieval.ZooKeeperLeaderRetrievalService  - Starting ZooKeeperLeaderRetrievalService.
2017-09-29 08:08:41,722 INFO  org.apache.flink.runtime.clusterframework.standalone.StandaloneResourceManager  - Received leader address but not running in leader ActorSystem. Cancelling registration.
2017-09-29 09:26:13,472 WARN  akka.remote.ReliableDeliverySupervisor                        - Association with remote system [akka.tcp://flink@ad011.local:50000] has failed, address is now gated for [5000] ms. Reason: [Disassociated] 
2017-09-29 09:26:14,274 INFO  org.apache.flink.runtime.jobmanager.JobManager                - RECEIVED SIGNAL 15: SIGTERM. Shutting down as requested.
2017-09-29 09:26:14,284 INFO  org.apache.flink.runtime.blob.BlobServer                      - Stopped BLOB server at 0.0.0.0:6132

任何帮助都将不胜感激。

polhcujo

polhcujo1#

解决方法是使用./bin/start-cluster.sh运行我的集群,而不是使用服务文件(调用相同的脚本),服务文件显然会杀死其他作业管理器。

相关问题