Kafka docker image installation usage tutorial windows. Install and run Kafka in minutes. Easy Kafka Tutorial. Run Kafka on on Windows system. Kafka docker image installation usage tutorial windows. Install and run Kafka in minutes. We will use a docker image to install Kafka. The image we’ll use here, is developed by Landoop. All you need is Docker and Confluent Docker images for Apache Kafka and friends. If you need an example or template for containerizing your Kafka Streams application, take a look at the source code of the Docker image we used for this blog post.
I’m trying (and failing) to run a dockerized kafka on my mac machine (MacOS Sierra (10.12.2)). I have Docker for Mac version 17.03.1-ce, build c6d412e. These are the images I’m using.
And I’m following the advice in the official, running Zookeeper and Kafka with the following commands. Docker run -d -net=host -name=zookeeper -e ZOOKEEPERCLIENTPORT=32181 confluentinc/cp-zookeeper:3.2.1 docker run -d -net=host -name=kafka -e KAFKAZOOKEEPERCONNECT=localhost:32181 -e KAFKAADVERTISEDLISTENERS=PLAINTEXT://localhost:29092 confluentinc/cp-kafka:3.2.1 MAIN This otherwise doesn’t work with docker-compose. Again it's on my mac, version 1.11.2, build dfed245. Version: '2' services: zookeeper: image: confluentinc/cp-zookeeper:3.2.2 environment: - ZOOKEEPERCLIENTPORT=2181 ports: - 2181:2181 kafka: image: confluentinc/cp-kafka:3.2.2 environment: - KAFKABROKERID=0 - KAFKAZOOKEEPERCONNECT=zookeeper:2181 - KAFKAADVERTISEDLISTENERS=PLAINTEXT://kafka:9092 - KAFKAAUTOCREATETOPICSENABLE=true ports: - 9092:9092 - 8082:8082 dependson: - zookeeper The services will start, and I can even create a topic with these commands. Kafka-topics -create -zookeeper zookeeper:2181 -replication-factor 1 -partitions 1 -topic test kafka-topics -list -zookeeper zookeeper:2181 When I try to produce with this command, zookeeper remains silent. Kafka-console-producer -broker-list kafka:9092 -topic test message-one message-two When I try to consume with this command: kafka-console-consumer -bootstrap-server zookeeper:2181 -topic test -from-beginning.
Zookeeper continuously spits out this error. Zookeeper1 2017-06-28 00:55:07,222 INFO Accepted socket connection from /172.20.0.3:52124 (org.apache.zookeeper.server.NIOServerCnxnFactory) zookeeper1 2017-06-28 00:55:07,222 WARN Exception causing close of session 0x0 due to java.io.EOFException (org.apache.zookeeper.server.NIOServerCnxn) zookeeper1 2017-06-28 00:55:07,223 INFO Closed socket connection for client /172.20.0.3:52124 (no session established for client) (org.apache.zookeeper.server.NIOServerCnxn).
You have specified the wrong host and port for the new console consumer. Try console-consumer -bootstrap-server kafka:9092 -topic test -from-beginning Also if you are running these commands from outside docker (I.e. On the native macOS host) then edit your /etc/hosts file to add kafka and zookeeper as aliases for localhost You might also want to declare and mount an external volume for the zookeeper and kafka logs so your data won't be lost if you destroy the docker images and upgrade to a newer version.
Confluent has a full QuickStart documented for these images here.