Flink TaskManager没有重新连接到新的Jobmanager

时间:2018-07-25 14:20:08

标签: java apache-zookeeper apache-flink flink-streaming

我已按照here的说明在HA模式下配置了Flink:

我想测试容错能力,因此我执行了以下操作:

  1. 使用2个JobManager和1个TaskManager设置Flink集群
  2. 在任务管理器上启动流式作业
  3. 杀死主动的作业管理器(以模拟崩溃)
  4. 领导人选举按预期进行。
  5. 但是注意到任务管理器正在重新连接到新的任务管理器。它只是尝试每10秒重新连接到上一个领导者。

在此处粘贴任务管理器日志:

2018-07-25 19:46:08,508 INFO  org.apache.flink.runtime.taskexecutor.TaskManagerConfiguration  - Messages have a max timeout of 10000 ms
2018-07-25 19:46:08,515 INFO  org.apache.flink.runtime.rpc.akka.AkkaRpcService              - Starting RPC endpoint for org.apache.flink.runtime.taskexecutor.TaskExecutor at akka://flink/user/taskmanager_0 .
2018-07-25 19:46:08,524 INFO  org.apache.flink.runtime.leaderretrieval.ZooKeeperLeaderRetrievalService  - Starting ZooKeeperLeaderRetrievalService /leader/resource_manager_lock.
2018-07-25 19:46:08,525 INFO  org.apache.flink.runtime.taskexecutor.JobLeaderService        - Start job leader service.
2018-07-25 19:46:08,529 INFO  org.apache.flink.runtime.taskexecutor.TaskExecutor            - Connecting to ResourceManager akka.tcp://flink@10.10.97.210:46477/user/resourcemanager(b91b9aeb3565be973c9bb47259414e0a).
2018-07-25 19:46:08,574 WARN  akka.remote.transport.netty.NettyTransport                    - Remote connection to [null] failed with java.net.ConnectException: Connection refused: /10.10.97.210:46477
2018-07-25 19:46:08,576 WARN  akka.remote.ReliableDeliverySupervisor                        - Association with remote system [akka.tcp://flink@10.10.97.210:46477] has failed, address is now gated for [50] ms. Reason: [Association failed with [akka.tcp://flink@10.10.97.210:46477]] Caused by: [Connection refused: /10.10.97.210:46477]
2018-07-25 19:46:08,579 INFO  org.apache.flink.runtime.taskexecutor.TaskExecutor            - Could not resolve ResourceManager address akka.tcp://flink@10.10.97.210:46477/user/resourcemanager, retrying in 10000 ms: Could not connect to rpc endpoint under address akka.tcp://flink@10.10.97.210:46477/user/resourcemanager..
2018-07-25 19:46:18,606 WARN  akka.remote.transport.netty.NettyTransport                    - Remote connection to [null] failed with java.net.ConnectException: Connection refused: /10.10.97.210:46477
2018-07-25 19:46:18,607 WARN  akka.remote.ReliableDeliverySupervisor                        - Association with remote system [akka.tcp://flink@10.10.97.210:46477] has failed, address is now gated for [50] ms. Reason: [Association failed with [akka.tcp://flink@10.10.97.210:46477]] Caused by: [Connection refused: /10.10.97.210:46477]
2018-07-25 19:46:18,607 INFO  org.apache.flink.runtime.taskexecutor.TaskExecutor            - Could not resolve ResourceManager address akka.tcp://flink@10.10.97.210:46477/user/resourcemanager, retrying in 10000 ms: Could not connect to rpc endpoint under address akka.tcp://flink@10.10.97.210:46477/user/resourcemanager..
  1. 重新启动任务管理器没有帮助
  2. 重新启动群集没有帮助

如果有任何遗漏,请指导我。

1 个答案:

答案 0 :(得分:1)

查看日志:

连接被拒绝:/10.10.97.210:46477

端口 46477 是否已从防火墙打开/排除?

只需检查您是否在flink config中设置了以下内容:

jobmanager.rpc.port: 6123 
blob.server.port: 50100-50200 

然后解除阻止这些端口。