Apache Kafka on Windows

A high-throughput distributed messaging system.

Short Introduction :

  • Originally created by LinkedIn, contributed to Apache in July 2011.
  • Kafka is written in Scala.
  • Multi-language support for Publish/Consumer API.
  • Active deployment, 0.8 out now.

Install Kafka on Windows:

NOTE: You need to install Java SE Server JRE and update the system environment path variable like here.

I downloaded the 0.8.2.1 version under Binary downloads Scala 2.10 – direct link.

After unzipping the .tgz files with 7zip, the folder structure will look like below snapshot. I placed it in E:/Kafka.

Downloaded_Unzipped_Kafka

You can also check there will be windows folder inside bin folder.

Now we also have to install Zookeeper for Kafka as Kafka uses Zookeeper for storing variety configuration values. You can find more information here.

Install Zookeeper: I downloaded Zookeeper – 3.5.0 –alpha from downloadsdirect link.

After unzipping .tar.gz file using 7zip, the folder structure will look like below. I placed it in E:/Zookeeper.

Downloaded_Unzipped_Zookeeper

Open zoo.cfg file placed in “Zookeeper-3.5.0-alpha/conf” and Change the dataDir path in zoo.cfg file. I set the path to E:\Zookeeperdata.

image

Now, First we will start Zookeeper and then Kafka.

Right Click zkServer.cmd file and click Run as administrator. It will be inside “Zookeeper-3.5.0-alpha/bin”.

Start_Zookeeper

Hurray! Zookeeper started successfully.

image

Now Open server.properties file placed in “Kafka_2.10-0.8.2.1/config”. Change the log.dirs path to some valid path. I changed it to E:/Kafka/kafka-logs.

image

Open command window and run the kafka-server-start.bat and pass server.properties file path like below snapshot.

image

Hurray! Kafka is running.

image