kafka前段时间没有问题,这两天总是报错

提问说明

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}





发表于: 1月前   最后更新时间: 1月前   游览量:166
上一条: 到头了!
下一条: 已经是最后了!

  • 网上说这个错误需要修改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方法,自己自定义了主题。
      运行项目:现在经常报:
      异常一:
      2019-05-16 18:00:58.326 ERROR [http-nio-9202-exec-64] o.springframework.kafka.support.LoggingProducerListener.onError: 76 ---------Exception thrown when sending a message with key='1558000798326' and payload='{"content":"ok","level":1,"operation":"login","ts":1558000797,"user":"admin"}' to topic d_android_078cc8fb-b3ca-4c61-81e1-ee73bc6d9094_log_1:
      org.apache.kafka.common.errors.TimeoutException: Failed to update metadata after 60000 ms.

      异常二:
      2019-05-16 18:00:57.899 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 45735 : {d_android_bdab2e6e-8e1f-499d-9428-87d5160375a7_log_1=INVALID_REPLICATION_FACTOR, d_android_05e5a80e-3912-40f3-a9f9-ba0751d86daa_log_1=INVALID_REPLICATION_FACTOR, d_android_4a0e8d8e-8ea0-40b6-9501-2b94aee4f1c7_log_1=INVALID_REPLICATION_FACTOR, d_android_078cc8fb-b3ca-4c61-81e1-ee73bc6d9094_log_1=INVALID_REPLICATION_FACTOR, d_android_d85eed68-1396-4d65-a867-6cca533f2e62_log_1=INVALID_REPLICATION_FACTOR, d_android_0419f16a-e330-45e0-a3ad-df26194ce7f6_log_1=INVALID_REPLICATION_FACTOR, d_android_d0a1cf43-eb44-4286-a0ed-464b3efde003_log_1=INVALID_REPLICATION_FACTOR, d_android_c23805b6-be91-44e7-8875-89342127ccef_log_1=INVALID_REPLICATION_FACTOR}



      项目偶尔可以正常使用,但是后台日志经常会报这种错误