Closed 3AceShowHand closed 4 days ago
At the very first, the environment looks like this:
ALLOW_PLAINTEXT_LISTENER: yes
KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: "3"
KAFKA_CFG_TRANSACTION_STATE_LOG_MIN_ISR: "2"
KAFKA_CFG_ZOOKEEPER_CONNECT: downstream-zk.${testbed}:2181
KAFKA_HEAP_OPTS: -Xmx512M -Xms512M -XX:ParallelGCThreads=1
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "3"
KAFKA_OPTS: -Dlogging.level=INFO
KAFKA_TRANSACTION_STATE_LOG_MIN_ISR: "2"
KAFKA_ZOOKEEPER_CONNECT: downstream-zk.${testbed}:2181
We meet the error
kafka server: Replication-factor is invalid - Unable to replicate the partition 3 time(s): The target replication factor of 3 cannot be reached because only 1 broker(s) are registered.
By reading the documention, I think it may caused by the kraft mode, so add KAFKA_ENABLE_KRAFT=false
, we hope to use the zk mode.
After this change, we meet this error
java.lang.IllegalArgumentException: Error creating broker listeners from 'PLAINTEXT://:9092,CONTROLLER://:9093': No security protocol defined for listener CONTROLLER
By reading the #43918, change the environment variable, still not work.
Hi!
Could you share a docker-compose.yml that triggers the issue? So we can easily reproduce
This is fixed by set environment variable, close this issue:
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT"
The minimum reproduce docker compose file looks like this:
version: '3.7'
services:
zookeeper:
image: zookeeper
container_name: zookeeper
ports:
- "2181:2181"
volumes:
- /tmp/zookeeper/data:/data
- /tmp/zookeeper/datalog:/datalog
- /tmp/zookeeper/logs:/logs
restart: always
kafka1:
image: registry-mirror.pingcap.net/bitnami/kafka:3.5.0
depends_on:
- zookeeper
container_name: kafka1
ports:
- 9092:9092
environment:
KAFKA_HEAP_OPTS: "-Xmx512M -Xms512M -XX:ParallelGCThreads=1"
KAFKA_OPTS: "-Dlogging.level=INFO"
KAFKA_CFG_ZOOKEEPER_CONNECT: zookeeper:2181
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
ALLOW_PLAINTEXT_LISTENER: "yes"
KAFKA_CFG_INTER_BROKER_LISTENER_NAME: "PLAINTEXT"
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "PLAINTEXT:PLAINTEXT"
KAFKA_CFG_OFFSETS_TOPIC_REPLICATION_FACTOR: "3"
KAFKA_OFFSETS_TOPIC_REPLICATION_FACTOR: "3"
KAFKA_ENABLE_KRAFT: "false"
volumes:
- /tmp/kafka1/data:/data/kafka-data
restart: unless-stopped
This is fixed by set environment variable, close this issue:
KAFKA_CFG_LISTENER_SECURITY_PROTOCOL_MAP: "PLAINTEXT:PLAINTEXT,CONTROLLER:PLAINTEXT"
I am curious why I have to set this environment variable to make the zookeeper mode works.
Hi,
It is not clear to me that this issue is related with the Bitnami packaging of Kafka. It seems more that something directly related with how Kafka is implemented. I would check with the upstream Kafka devs
This Issue has been automatically marked as "stale" because it has not had recent activity (for 15 days). It will be closed if no further activity occurs. Thanks for the feedback.
Due to the lack of activity in the last 5 days since it was marked as "stale", we proceed to close this Issue. Do not hesitate to reopen it later if necessary.
Name and Version
bitnami/kafka:3.5.0
What architecture are you using?
amd64
What steps will reproduce the bug?
What is the expected behavior?
The 3 nodes kafka cluster can be running succesfully.
What do you see instead?
Additional information
We do not want to enable the kraft, so add the environment variable
KAFKA_ENABLE_KRAFT: false