org.apache.kafka.common.KafkaException: Socket server failed to bind to 120.53.28.115:9092: Cannot assign requested address.
at kafka.network.Acceptor.openServerSocket(SocketServer.scala:661)
at kafka.network.Acceptor.<init>(SocketServer.scala:529)
at kafka.network.SocketServer.createAcceptor(SocketServer.scala:277)
at kafka.network.SocketServer.$anonfun$createDataPlaneAcceptorsAndProcessors$1(SocketServer.scala:250)
at kafka.network.SocketServer.$anonfun$createDataPlaneAcceptorsAndProcessors$1$adapted(SocketServer.scala:248)
at scala.collection.mutable.ResizableArray.foreach(ResizableArray.scala:62)
at scala.collection.mutable.ResizableArray.foreach$(ResizableArray.scala:55)
at scala.collection.mutable.ArrayBuffer.foreach(ArrayBuffer.scala:49)
at kafka.network.SocketServer.createDataPlaneAcceptorsAndProcessors(SocketServer.scala:248)
at kafka.network.SocketServer.startup(SocketServer.scala:122)
at kafka.server.KafkaServer.startup(KafkaServer.scala:286)
at kafka.server.KafkaServerStartable.startup(KafkaServerStartable.scala:44)
at kafka.Kafka$.main(Kafka.scala:82)
at kafka.Kafka.main(Kafka.scala)
Caused by: java.net.BindException: Cannot assign requested address
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 sun.nio.ch.ServerSocketAdaptor.bind(ServerSocketAdaptor.java:78)
at kafka.network.Acceptor.openServerSocket(SocketServer.scala:657)
... 13 more
listeners=PLAINTEXT://:9092
advertised.listeners=PLAINTEXT://公网ip:9092
listeners一定是直接取消注释,不要加ip或者域名了,千万不要被上面的说明误导。
至于为什么,我也不知道