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

即可解决问题。

©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容

  • Spring Cloud为开发人员提供了快速构建分布式系统中一些常见模式的工具(例如配置管理,服务发现,断路器,智...
    卡卡罗2017阅读 134,841评论 18 139
  • 姓名:周小蓬 16019110037 转载自:http://blog.csdn.net/YChenFeng/art...
    aeytifiw阅读 34,742评论 13 425
  • Kafka官网:http://kafka.apache.org/入门1.1 介绍Kafka™ 是一个分布式流处理系...
    it_zzy阅读 3,911评论 3 53
  • 灯火稀落 转瞬即逝 平行的焰火 宇宙的璀璨 时间被拉伸 空气被鼓动 唤醒了精灵 鸣响了黑夜 悄无声息 颓然自伤 摸...
    mydearyanyan阅读 169评论 0 1
  • 关于python 1. python是什么 python是一种编程语言,功能非常强大,语法简单清晰。非常适合刚学习...
    Davidham3阅读 403评论 0 2