I tried to run kafka and zookeeper containers cp-kafka and cp-zookeeper images with this docker compose file,
# https://github.com/confluentinc/cp-all-in-one/blob/ba229841f2a22410aba02b43738bc00e30718718/cp-all-in-one/docker-compose.yml
version: '3'
services:
zookeeper:
image: confluentinc/cp-zookeeper:7.3.0
container_name: zookeeper
ports:
- "2181:2181"
environment:
ZOOKEEPER_CLIENT_PORT: 2181
ZOOKEEPER_TICK_TIME: 2000
broker:
image: confluentinc/cp-kafka:7.3.0
container_name: broker
ports:
- "9092:9092"
depends_on:
- zookeeper
environment:
KAFKA_BROKER_ID: 1
KAFKA_ZOOKEEPER_CONNECT: "zookeeper:2181"
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: PLAINTEXT:PLAINTEXT,PLAINTEXT_HOST:PLAINTEXT
KAFKA_ADVERTISED_LISTENERS: PLAINTEXT://broker:29092,PLAINTEXT_HOST://localhost:9092
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: 1
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: 1
KAFKA_TRANSACTION_STATE_LOG_REPLICATION_FACTOR: 1
mongodb:
container_name: mongo_c
image: mongo:6.0
volumes:
- ./db:/data/db
ports:
- "27017:27017"
environment:
MONGO_INITDB_ROOT_USERNAME: root
MONGO_INITDB_ROOT_PASSWORD: example
The kafka instance is stuck with this log message,
broker | [2023-11-19 01:31:45,996] INFO [Controller id=1] Processing automatic preferred replica leader election (kafka.controller.KafkaController)
broker | [2023-11-19 01:31:45,998] TRACE [Controller id=1] Checking need to trigger auto leader balancing (kafka.controller.KafkaController)
I am using Ubuntu and your help is highly appreciated!