kafka无法消费

自己动手写了一个kafka消费实例,但是执行时总是报错:

2018-06-19 15:40:24.146 INFO  AbstractCoordinator - [Consumer clientId=consumer-1, groupId=dfp] Marking the coordinator localhost:9092 (id: 2147483647 rack: null) dead
2018-06-19 15:40:25.153 WARN  NetworkClient - [Consumer clientId=consumer-1, groupId=dfp] Connection to node 0 could not be established. Broker may not be available.
2018-06-19 15:40:26.206 WARN  NetworkClient - [Consumer clientId=consumer-1, groupId=dfp] Connection to node 0 could not be established. Broker may not be available.
2018-06-19 15:40:27.311 WARN  NetworkClient - [Consumer clientId=consumer-1, groupId=dfp] Connection to node 0 could not be established. Broker may not be available.
2018-06-19 15:40:28.514 WARN  NetworkClient - [Consumer clientId=consumer-1, groupId=dfp] Connection to node 0 could not be established. Broker may not be available.

在kafka的配置文件server.properties中添加设置如下:

listeners=PLAINTEXT://10.100.1.200:9092

即可解决问题。

    原文作者:adonisjph
    原文地址: https://www.jianshu.com/p/80bfd67f52f9
    本文转自网络文章,转载此文章仅为分享知识,如有侵权,请联系博主进行删除。
点赞