美文网首页
单机Flink TaskExecutor no more all

单机Flink TaskExecutor no more all

作者: 怒放的葱花 | 来源:发表于2021-02-23 16:32 被阅读0次

问题描述: 根据官方文档示例文档操作步骤,可正常在单机模式启动Flink,但提交WordCount示例时任务执行失败并出现类似:TaskExecutor akka.tcp://xxx has no more allocated slots for job nnn错误

测试环境:

  • Catalina 10.15
  • JDK 8
  • Flink 1.12


    错误样式

问题原因及解决方法

原因:出现该问题的主要原因是因为在我们本地测试时,默认jobmanager配置的地址是localhost,但taskmanager在初始化时使用的ip却是本机局域网IP,如192.168.*;10.*等,造成任务执行过程中JobManager向TaskManager申请计算资源执行任务时无法正常获取Slots算子

TaskManager IP非localhost
解决方案:
修改flink-conf.yaml配置并添加配置指定TaskManager注册地址
taskmanager.host: localhost

官方配置说明文档,修改完成后重启集群

$ ./bin/stop-cluster.sh  #停止集群
$ ./bin/start-cluster.sh  #启动集群
$ ./bin/flink run examples/streaming/WordCount.jar  #提交示例任务

重新运行示例即可正常执行

相关文章

网友评论

      本文标题:单机Flink TaskExecutor no more all

      本文链接:https://www.haomeiwen.com/subject/dmarfltx.html