Flink报错: java.net.BindException: Could not start rest endpoint on any port in port range 10000

Flink报错: java.net.BindException: Could not start rest endpoint on any port in port range 10000,第1张

Flink报错: java.net.BindException: Could not start rest endpoint on any port in port range 10000 项目场景:

Flink算子执行报错:
Caused by: java.net.BindException: Could not start rest endpoint on any port in port range 10000
    at org.apache.flink.runtime.rest.RestServerEndpoint.start(RestServerEndpoint.java:234)
    at org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory.create(DefaultDispatcherResourceManagerComponentFactory.java:172)
    ... 11 more
 


问题描述:

具体的报错日志:

org.apache.flink.util.FlinkException: Could not create the DispatcherResourceManagerComponent.
    at org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory.create(DefaultDispatcherResourceManagerComponentFactory.java:275)
    at org.apache.flink.runtime.minicluster.MiniCluster.createDispatcherResourceManagerComponents(MiniCluster.java:463)
    at org.apache.flink.runtime.minicluster.MiniCluster.setupDispatcherResourceManagerComponents(MiniCluster.java:422)
    at org.apache.flink.runtime.minicluster.MiniCluster.start(MiniCluster.java:366)
    at org.apache.flink.client.program.PerJobMiniClusterFactory.submitJob(PerJobMiniClusterFactory.java:75)
    at org.apache.flink.client.deployment.executors.LocalExecutor.execute(LocalExecutor.java:85)
    at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.executeAsync(StreamExecutionEnvironment.java:1957)
    at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1848)
    at org.apache.flink.streaming.api.environment.LocalStreamEnvironment.execute(LocalStreamEnvironment.java:69)
    at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1834)
    at org.apache.flink.streaming.api.environment.StreamExecutionEnvironment.execute(StreamExecutionEnvironment.java:1817)
    at com.atguigu.chapter05.transform.Flink01_MapFunction.main(Flink01_MapFunction.java:34)
Caused by: java.net.BindException: Could not start rest endpoint on any port in port range 10000
    at org.apache.flink.runtime.rest.RestServerEndpoint.start(RestServerEndpoint.java:234)
    at org.apache.flink.runtime.entrypoint.component.DefaultDispatcherResourceManagerComponentFactory.create(DefaultDispatcherResourceManagerComponentFactory.java:172)
    ... 11 more

原因分析:

这个提示十分明显,就是port端口的问题导致的。

conf.setInteger("rest.port", 10000);

代码中我设置的是10000,发现此端口被占用了。


解决方案:

修改一下端口即可。

conf.setInteger("rest.port", 9999);

问题解决。

欢迎分享,转载请注明来源:内存溢出

原文地址: http://outofmemory.cn/zaji/5680851.html

(0)
打赏 微信扫一扫 微信扫一扫 支付宝扫一扫 支付宝扫一扫
上一篇 2022-12-17
下一篇 2022-12-17

发表评论

登录后才能评论

评论列表(0条)

保存