paul
paul

Reputation: 13471

Docker image with Kafka and Zookepper

I´m trying to run Kafka and Zookepper using Docker, following the steps defined here: https://github.com/spotify/docker-kafka

But after running, just as described, the docker container

docker run -p 2181:2181 -p 9092:9092 --env ADVERTISED_HOST=`docker-machine ip \`docker-machine active\`` --env ADVERTISED_PORT=9092 spotify/kafka

I´m not able to publish anything and if I make a wget localhost:9092 I receive empty response.

I don't understand what for are the exports, mentioned in the documentation.

Any idea if I´m doing something wrong?

Also if somebody know a better image please let me know.

Upvotes: 1

Views: 1315

Answers (1)

OneCricketeer
OneCricketeer

Reputation: 191725

Kafka doesn't run HTTP server. Port 9092 over wget doesn't do anything

You need to describe the topics using the kafka-topics command, which can be found in the documentation, which will connect to Zookeeper over the port 2181.

Something like

docker exec kafka-zk kafka-topics --list --zookeeper localhost:2181

If you wanted to make an HTTP request, you would need Kafka REST proxy, which I believe is only in the Confluent images

Upvotes: 3

Related Questions