kafka安装
安装教程
问题
在生产消息时,发生如下问题:
1 | WARN Error while fetching metadata with correlation id 1 : {test=LEADER_NOT_AVAILABLE} (org.apache.kafka.clients.NetworkClient) |
controller.log日志如下:
1 | [2018-11-08 10:26:48,704] WARN [Controller-0-to-broker-0-send-thread], Controller 0's connection to broker 222.221.5.253:9092 (id: 0 rack: null) was unsuccessful (kafka.controller.RequestSendThread) |
解决
修改配置文件config/server.properties
后重新启动zookeeper和kafka即可。
修改配置如下:
1 | #原配置:listeners=PLAINTEXT://:9092 |
常用命令
查看当前消费位置
1 | ./bin/kafka-consumer-groups.sh --bootstrap-server 172.16.123.12:9092,172.16.123.13:9092,172.16.123.14:9092 --describe --group userservice |