setting up Apache Kafka in windows

  1. Download and Setup Java 8 JDK
  2. Download the Kafka binaries from https://kafka.apache.org/downloads
  3. Extract Kafka at the root of C:\
  4. Setup Kafka bins in the Environment variables section by editing Path

added the following path to the user variables in environmental variables

C:\kafka_2.12–2.0.0\bin\windows

  1. Try Kafka commands using kafka-topics.bat (for example)
kafka commands in comandline

if the environement variables are set properly you willl get the abpve output.since the env varibalesa are set ypu wont have to always call from the root directory.

then make a new directory in the root folder named data

inside this make another 2 folders zookeeper and kafka ,copy the paths to both these folders and go to config folder and in zookeper.properties and server.properties files add these new paths.

create data folder and add another 2 folders inside it kafka and zookeeper
inside data folder

copy the 2 paths to these two folders because we need to include them in config files . C:\kafka_2.12-2.0.0\data\zookeeper & C:\kafka_2.12-2.0.0\data\kafka

follow the below mentioned steps

  1. Edit Zookeeper & Kafka configs using NotePad++ https://notepad-plus-plus.org/download/

here i used sublime text .you can use your preferred text editor to get this done.

edit these files and add new path to newly created zookeeper and kafka folders in data folder

zookeeper.properties: dataDir=C:/kafka_2.12-2.0.0/data/zookeeper (yes the slashes are inversed)

server.properties: log.dirs=C:/kafka_2.12-2.0.0/data/kafka(since this is windows make all the backward slashes forward slashes ,yes the slashes are inversed)

  1. Start Zookeeper in one command line: zookeeper-server-start.bat config\zookeeper.properties

zookeeper server will start running

  1. Start Kafka in another command line: kafka-server-start.bat config\server.properties
Sithija Thewahettige

Written by

Software Engineering Intern @ mubasher technologies

Welcome to a place where words matter. On Medium, smart voices and original ideas take center stage - with no ads in sight. Watch
Follow all the topics you care about, and we’ll deliver the best stories for you to your homepage and inbox. Explore
Get unlimited access to the best stories on Medium — and support writers while you’re at it. Just $5/month. Upgrade