You are currently viewing A step-by-step guide for Apache Kafka installation on Windows

A step-by-step guide for Apache Kafka installation on Windows

Loading

Welcome to our Windows Apache Kafka installation instructions! In this detailed article, we’ll help you install Kafka on Windows so you can use real-time data streaming for your projects with confidence.”

Apache Kafka installation on windows

There are some prerequisites you have to install.

The second step is to install Apache Kafka: https://kafka.apache.org/downloads

You have to go to Binary download and select the Scala 2.13 Version

Extract it, rename the folder to kafka and place it on the C drive.

Create two folders kafka-logs and zookeeper-data under Kafka folder

Update config\server.properties as follows:

  • log.dirs=C:/kafka/kafka-logs

Update config\zookeeper.properties as follows:

  • dataDir=C:/kafka/zookeeper-data

Update the bin > windows >kafka-run-class.bat file as follows:

lines 224 to 229 from this

# Which java to use
if [ -z "$JAVA_HOME" ]; then
  JAVA="java"
else
  JAVA="$JAVA_HOME/bin/java"
fi
to this:

# Which java to use
if [ -z "$JAVA_HOME" ]; then
  JAVA="java"
else
  JAVA="$JAVA_HOME/java"
fi

Now open the cmd from the Kafka folder

  • .\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties

Now open another cmd from the Kafka folder

  • .\bin\windows\kafka-server-start.bat .\config\server.properties

Now create the topic named as test

Open cmd in kafka> bin> windows folder

  • kafka-topics.bat –create –bootstrap-server localhost:9092 –topic test

Now turn on the producer and pass the data

  • kafka-console-producer.bat –broker-list localhost:9092 –topic test

Now start the consumer in another cmd

  • kafka-console-consumer.bat –topic test –bootstrap-server localhost:9092 –from-beginning

Conclusion

In this tutorial, we have learned about the Kafka installation.

Tell me in the comments if you have any problems regarding implementation, and I will reply within 24 hours.

If you like the article and would like to support me, make sure to:

This Post Has One Comment

Comments are closed.