Flink:HA模式杀死领先的jobmanager终止备用jobmanagers

时间:2017-09-29 13:28:32

标签: apache-zookeeper apache-flink

我正在尝试让Flink使用Zookeeper在HA模式下运行,但是当我尝试通过杀死领导者JobManager来测试它时,我的所有备用作业管理器也会被杀死。

因此,作为新领导者的替代职位管理员不会接替他们,他们都会被杀死,这不应该发生。

我的设置: 4台服务器,其中3台服务器运行Zookeeper,但只有1台服务器将托管所有JobManagers。

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

我的主人档案如下:

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正在运行,并且转到WebUI,他们都指向ad011.local:8081,这是领导者。哪个好我猜?

然后我尝试通过使用kill杀死领导者来测试故障转移,然后我的所有其他备用JobManagers也停止。

这是我在备用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

任何帮助都将不胜感激。

1 个答案:

答案 0 :(得分:2)

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