kafka distributed 模式下,报错: java.net.BindException: Address already in use

一如乞人不需要形象 发表于: 2020-07-01   最后更新时间: 2020-07-01 10:28:12   2,587 游览

distributed 模式下,三个broker,报错:

[2020-06-30 12:59:54,050] INFO jetty-9.4.24.v20191120; built: 2019-11-20T21:37:49.771Z; git: 363d5f2df3a8a28de40604320230664b9c793c16; jvm 1.8.0_252-b09 (org.eclipse.jetty.server.Server:359)
[2020-06-30 12:59:54,072] ERROR Stopping due to error (org.apache.kafka.connect.cli.ConnectDistributed:84)
      org.apache.kafka.connect.errors.ConnectException: Unable to initialize REST server
      at org.apache.kafka.connect.runtime.rest.RestServer.initializeServer(RestServer.java:215)
      at org.apache.kafka.connect.cli.ConnectDistributed.startConnect(ConnectDistributed.java:99)
      at org.apache.kafka.connect.cli.ConnectDistributed.main(ConnectDistributed.java:78)
      Caused by: java.io.IOException: Failed to bind to 0.0.0.0/0.0.0.0:8083
      at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:346)
      at org.eclipse.jetty.server.ServerConnector.open(ServerConnector.java:307)
      at org.eclipse.jetty.server.AbstractNetworkConnector.doStart(AbstractNetworkConnector.java:80)
      at org.eclipse.jetty.server.ServerConnector.doStart(ServerConnector.java:231)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
      at org.eclipse.jetty.server.Server.doStart(Server.java:385)
      at org.eclipse.jetty.util.component.AbstractLifeCycle.start(AbstractLifeCycle.java:72)
      at org.apache.kafka.connect.runtime.rest.RestServer.initializeServer(RestServer.java:213)
      ... 2 more
Caused by: java.net.BindException: Address already in use
      at sun.nio.ch.Net.bind0(Native Method)
      at sun.nio.ch.Net.bind(Net.java:433)
      at sun.nio.ch.Net.bind(Net.java:425)
      at sun.nio.ch.ServerSocketChannelImpl.bind(ServerSocketChannelImpl.java:220)
      at sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:85)
      at org.eclipse.jetty.server.ServerConnector.openAcceptChannel(ServerConnector.java:342)

请问是什么原因,需要做什么配置吗?

发表于 2020-07-01

端口被占用了

三个broker在开启distributed 模式时,都会占用本地的8083啊,否则应该怎么做?

你的答案

查看kafka相关的其他问题或提一个您自己的问题