1、kafka启动没有反应,创建topic时报错
2、报错后修改过server.properties文件的listeners和advertised.listeners,仍然无效
报错信息:
WARN [AdminClient clientId=adminclient-1] Connection to node -1 (/10.25.110.107:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
默认是
127.0.0.1
,所以需要修改server.properties
配置中的listeners
:listeners= PLAINTEXT://10.25.110.107:9092
只配置listeners就好了
1、
10.25.110.107
要是内网,并且在同一台机器执行创建topic操作的。2、查看下kafka日志,是否有异常信息
3、换回
127.0.0.1
,测试是默认是否正常(排除网络地址错误)。好的,谢谢了
listeners= PLAINTEXT://[我的服务器对内ip]:9092
我已经修改了这个配置,但还是报这个错
Connection to node -1 (localhost/127.0.0.1:9092) could not be established. Broker may not be available. (org.apache.kafka.clients.NetworkClient)
然后进到server.log发现有如下报错:
ERROR Exiting Kafka due to fatal exception (kafka.Kafka$) java.nio.file.NoSuchFileException: config/server.propertie at sun.nio.fs.UnixException.translateToIOException(UnixException.java:86) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:102) at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:107) at sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:214) at java.nio.file.Files.newByteChannel(Files.java:361) at java.nio.file.Files.newByteChannel(Files.java:407) at java.nio.file.spi.FileSystemProvider.newInputStream(FileSystemProvider.java:384) at java.nio.file.Files.newInputStream(Files.java:152) at org.apache.kafka.common.utils.Utils.loadProps(Utils.java:666) at org.apache.kafka.common.utils.Utils.loadProps(Utils.java:653) at kafka.Kafka$.getPropsFromArgs(Kafka.scala:52) at kafka.Kafka$.main(Kafka.scala:86) at kafka.Kafka.main(Kafka.scala)
你kafka都没启动成功,没找到你的配置文件。
你的答案