такой конфиг докера
version: '3.7'
networks:
analytic:
driver: bridge
services:
zookeeper:
image: bitnami/zookeeper:3.6.2
env_file: zookeeper/.env
networks:
- analytic
ports:
- 2181:2181
kafka:
image: bitnami/kafka:2.6.0
ports:
- 9092:9092
environment:
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: 1
depends_on:
- zookeeper
networks:
- analytic
При попытке отправить сообщение ничего не выходит
kafkacat -L -b 127.0.0.1:9092
Metadata for all topics (from broker -1: 127.0.0.1:9092/bootstrap):
1 brokers:
broker 1010 at bcd7d80f3442:9092 (controller)
2 topics:
topic "events" with 1 partitions:
partition 0, leader -1, replicas: 1005, isrs: 1005, Broker: Leader not available
topic "__consumer_offsets" with 50 partitions:
partition 0, leader -1, replicas: 1001, isrs: 1001, Broker: Leader not available
....
echo '{"action": "read","event": "sdfsdf","service_name": "profile","session": "c3f94c52-6e05-4cfd-b974-14850a1335ba","user": "254c966d-f361-4f38-862d-4ee9717d8224"}' | kafkacat -P -b 127.0.0.1:9092 -t events
Что я делаю не так ?)
А чего бы не взять нормальный рабочий композ из любого Кафка туториала? https://kafka-tutorials.confluent.io/kafka-console-consumer-producer-basics/kafka.html#get-confluent-platform
Обсуждают сегодня