-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Home
This is a very common issue. The majority of the time this is due to configuration - please make sure you understand the Kafka networking requirements. Please refer to the Connectivity Guide for a brief overview.
It is needed to access the hosts Docker daemon from inside the container, i.e. 'Docker in Docker'. There are several places where this is used, none are required.
However, if this is omitted, the kafka-start.sh
script will no longer be able to automatically determine the KAFKA_ADVERTISED_PORT
. If this is required, please specify it manually in the environment.
Problem: Tools such as kafka-topics.sh
and kafka-console-producer.sh
fail when JMX is enabled. This is caused because of the JMX_PORT
environment variable. The Kafka helper script /opt/kafka/bin/kafka-run-class.sh
will try to invoke the required command in a new JVM with JMX bound to the specified port. As the broker JVM that is already running in the container has this port bound, the process fails and exits with error.
Solution: Although we'd recommend not running operation tools inside of your running brokers, this may sometimes be desirable when performing local development and testing.
Either prefix your command with JMX_PORT= <command>
or unset the environment variable, i.e. unset JMX_PORT
.
JMX_PORT= ./kafka-console-producer.sh --broker-list localhost:9092 --topic test
Use docker exec
, i.e
docker exec -it kafkadocker_kafka_1
It's been reported that COMPOSE_CONVERT_WINDOWS_PATHS fixes this issue.
Edit your local .envs file and set that parameter to true
or 1
echo "COMPOSE_CONVERT_WINDOWS_PATH=1` >> .env