Apache Kafka Setup in Windows

Prerequisite

Before proceeding, you need to have java installed.

Download link

Download the latest binary from https://kafka.apache.org/downloads

Setup

  1. Download and unzip, I have downloaded it into

“D:\kafka\”

2. Add below path in environment variables path

D:\kafka\bin\windows

3. Create three folders :

D:\kafka\data
D:\kafka\data\kafka
D:\kafka\data\zookeeper

D:\kafka\data>tree
D:.
├───kafka
└───zookeeper

4. Edit the file “D:\kafka\config\zookeeper.properties”

replace
dataDir=/tmp/zookeeper
with
dataDir=D:/kafka/data/zookeeper

Run below command

D:\kafka>zookeeper-server-start.bat config\zookeeper.properties

5. Edit the file “D:\kafka\config\server.properties”

replace
log.dirs=/tmp/kafka-logs
with
log.dirs=D:/kafka/data/kafka

Ruen below command

D:\kafka>kafka-server-start.bat config\server.properties

Now the folders/files should be similar to in “D:\kafka\data” folder

That's it, you are all set.

Happy Programming!