Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

producer fails on org.apache.kafka.common.errors.TimeoutException: Topic topicTest not present in metadata after 60000 ms. #553

Closed
adilev26 opened this issue Dec 15, 2019 · 1 comment

Comments

@adilev26
Copy link

I'm trying to produce messages to a kafka container and it seems to fail on produce.
connection seems OK.

docker-compose.yml
version: '2'
services:
zookeeper:
image: wurstmeister/zookeeper
ports:
- "2181:2181"
environment:
- ALLOW_ANONYMOUS_LOGIN=yes
kafka:
build: .
ports:
- "9092:9092"
- "9093:9093"
environment:
KAFKA_ADVERTISED_HOST_NAME: localhost
KAFKA_LISTENERS: INTERNAL://kafka:9093,EXTERNAL://127.0.0.1:9092
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9093,EXTERNAL://127.0.0.1:9092
KAFKA_LISTENER_SECURITY_PROTOCOL_MAP: INTERNAL:PLAINTEXT,EXTERNAL:PLAINTEXT
KAFKA_INTER_BROKER_LISTENER_NAME: INTERNAL
KAFKA_ZOOKEEPER_CONNECT: zookeeper:2181
volumes:
- /var/run/docker.sock:/var/run/docker.sock

tried with both :
.\kafka-console-producer.bat --broker-list 0.0.0.0:9092 --topic topicTest
and
.\kafka-console-producer.bat --broker-list localhost:9092 --topic topicTest

netstat shows listening on the port.

.\kafka-topics.bat --describe --zookeeper localhost:2181 --topic topicTest Topic:topicTest PartitionCount:1 ReplicationFactor:1 Configs:
Topic: topicTest Partition: 0 Leader: 1001 Replicas: 1001 Isr: 1001

any ideas ?

@adilev26
Copy link
Author

Found my issue!!!!

I've changed the following :

KAFKA_LISTENERS: INTERNAL://kafka:9093,EXTERNAL://127.0.0.1:9092
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9093,EXTERNAL://127.0.0.1:9092

into:

KAFKA_LISTENERS: INTERNAL://:9093,EXTERNAL://:9092
KAFKA_ADVERTISED_LISTENERS: INTERNAL://kafka:9093,EXTERNAL://localhost:9092

and it worked.

I guess that the KAFKA_LISTENERS property should not have addressed the localhost or something.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant