2019-05-16 14:28:40.661 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient.warn: 246 -------[Producer clientId=producer-1] Error while fetching metadata with correlation id 4254 : {d_android_190741b4-89a5-4f8c-832a-0b9e73ff8304_log_1=INVALID_REPLICATION_FACTOR, d_android_6ce83310-a25b-4255-bb69-877938bc8776_log_1=INVALID_REPLICATION_FACTOR, d_android_fb4e048b-47ce-4458-b41d-51b34c5571fe_log_1=INVALID_REPLICATION_FACTOR, d_android_b31fa4a8-245f-40ab-bbb9-7486295e2149_log_1=INVALID_REPLICATION_FACTOR}
2019-05-16 14:28:40.764 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient.warn: 246 -------[Producer clientId=producer-1] Error while fetching metadata with correlation id 4255 : {d_android_190741b4-89a5-4f8c-832a-0b9e73ff8304_log_1=INVALID_REPLICATION_FACTOR, d_android_6ce83310-a25b-4255-bb69-877938bc8776_log_1=INVALID_REPLICATION_FACTOR, d_android_fb4e048b-47ce-4458-b41d-51b34c5571fe_log_1=INVALID_REPLICATION_FACTOR, d_android_b31fa4a8-245f-40ab-bbb9-7486295e2149_log_1=INVALID_REPLICATION_FACTOR}
2019-05-16 14:28:40.867 WARN [kafka-producer-network-thread | producer-1] org.apache.kafka.clients.NetworkClient.warn: 246 -------[Producer clientId=producer-1] Error while fetching metadata with correlation id 4256 : {d_android_190741b4-89a5-4f8c-832a-0b9e73ff8304_log_1=INVALID_REPLICATION_FACTOR, d_android_6ce83310-a25b-4255-bb69-877938bc8776_log_1=INVALID_REPLICATION_FACTOR, d_android_fb4e048b-47ce-4458-b41d-51b34c5571fe_log_1=INVALID_REPLICATION_FACTOR, d_android_b31fa4a8-245f-40ab-bbb9-7486295e2149_log_1=INVALID_REPLICATION_FACTOR}
昵称
0 声望
这家伙太懒,什么都没留下
网上说这个错误需要修改kafka的配置文件。但是更改了之后,就会报连接不上Zookeep
描述信息太少,核心的配置也没贴。
application.yml中配置:
spring kafka: bootstrap-servers: localhost:9092
kafka server.properties中没有更改或增加任何配置
代码中:
private void send(String topic, String key, String data) { kafkaTemplate.send(topic, key, data); }
单纯用了send方法,自己自定义了主题。
运行项目:现在经常报:
异常一:
异常二:
项目偶尔可以正常使用,但是后台日志经常会报这种错误
你一直在本地调用吗?
1、你先查下集群状态。
2、生产者消费者代码和kafka都在同一台机器吗?
zookeep 用的是单机的 kafka配置我也是配的单机的
代码放在项目里面 项目和kafka,zookeep 都是放在服务器上的
你的答案