Exception:Connection to node 0 could not be established. Broker may not be available.

简介: Exception:Connection to node 0 could not be established. Broker may not be available.

问题:Java调用kafkaAPI写入数据失败,不报错


[main] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka version : 0.11.0.2
[main] INFO org.apache.kafka.common.utils.AppInfoParser - Kafka commitId : 73be1e1168f91ee2
[main] INFO org.apache.kafka.clients.producer.KafkaProducer - Closing the Kafka producer with timeoutMillis = 9223372036854775807 ms.
[kafka-producer-network-thread | producer-1] WARN org.apache.kafka.clients.NetworkClient - Connection to node 0 could not be established. Broker may not be available.
[kafka-producer-network-thread | producer-1] WARN org.apache.kafka.clients.NetworkClient - Connection to node 0 could not be established. Broker may not be available.
[kafka-producer-network-thread | producer-1] WARN org.apache.kafka.clients.NetworkClient - Connection to node 0 could not be established. Broker may not be available.
[kafka-producer-network-thread | producer-1] WARN org.apache.kafka.clients.NetworkClient - Connection to node 0 could not be established. Broker may not be available.
[kafka-producer-network-thread | producer-1] WARN org.apache.kafka.clients.NetworkClient - Connection to node 0 could not be established. Broker may not be available.
[kafka-producer-network-thread | producer-1] WARN org.apache.kafka.clients.NetworkClient - Connection to node 0 could not be established. Broker may not be available.
[kafka-producer-network-thread | producer-1] WARN org.apache.kafka.clients.NetworkClient - Connection to node 0 could not be established. Broker may not be available.
[kafka-producer-network-thread | producer-1] WARN org.apache.kafka.clients.NetworkClient - Connection to node 0 could not be established. Broker may not be available.


解决办法


前提:端口开放 9092 2888 3888

修改kafka的配置文件server.properties,按照自己的IP和主机名称修改下面的配置并且打开


1.png

感悟:日志的重要性


开始的时候没加日志配置文件和依赖,只知道运行很久才结束,不报错并且插入不成功,很奇怪

后来加入日志,一下就能看出是连接node失败,百度就解决了

目录
相关文章
|
6月前
|
消息中间件 Kafka
Kafka【问题 03】Connection to node -1 (/IP:9092) could not be established. Broker may not be available.
Kafka【问题 03】Connection to node -1 (/IP:9092) could not be established. Broker may not be available.
1000 0
|
2月前
|
消息中间件 Kafka Shell
Connection to node 0 (/172.17.0.8:9092) could not be established. Broker may not be available. 是什么问题?
Connection to node 0 (/172.17.0.8:9092) could not be established. Broker may not be available. 是什么问题?
273 9
|
消息中间件
RabbitMq没开启rabbitmq_management插件控制台报错Node statistics not available
RabbitMq没开启rabbitmq_management插件控制台报错Node statistics not available
|
6月前
./node_modules/vue-qr/dist/vue-qr.js报错You may need an appropriate loader to handle this file type问题
./node_modules/vue-qr/dist/vue-qr.js报错You may need an appropriate loader to handle this file type问题
|
消息中间件
RabbitMq Virtual host ‘myHost’ experienced an error on node XXXX and may be inaccessible
RabbitMq Virtual host ‘myHost’ experienced an error on node XXXX and may be inaccessible
875 0
RabbitMq Virtual host ‘myHost’ experienced an error on node XXXX and may be inaccessible
|
2月前
|
JavaScript
NodeJs的安装
文章介绍了Node.js的安装步骤和如何创建第一个Node.js应用。包括从官网下载安装包、安装过程、验证安装是否成功,以及使用Node.js监听端口构建简单服务器的示例代码。
NodeJs的安装
|
1月前
|
JavaScript 开发工具 git
已安装nodejs但是安装hexo报错
已安装nodejs但是安装hexo报错
30 2
|
2月前
|
存储 JavaScript 前端开发
Node 版本控制工具 NVM 的安装和使用(Windows)
本文介绍了NVM(Node Version Manager)的Windows版本——NVM for Windows的安装和使用方法,包括如何安装Node.js的特定版本、列出已安装版本、切换使用不同版本的Node.js,以及其他常用命令,以实现在Windows系统上对Node.js版本的便捷管理。
Node 版本控制工具 NVM 的安装和使用(Windows)
|
1月前
|
Web App开发 JavaScript 前端开发
JavaWeb 22.Node.js_简介和安装
JavaWeb 22.Node.js_简介和安装
下一篇
无影云桌面