Apache Kafka Zookeeper Setup In Windows and Linux
Table of Contents
In this article, we will discuss how to set up Apache Kafka Zookeeper Setup In Windows and Linux. In this process, I will explain Apache Kafka Zookeeper server installation, Apache Kafka server Installation, create a topic, configure the producer console to send a message, and consumer console to receive a message.
Prerequisites
- Java 1.8
- Apache Kafka
- Zookeeper
Java 1.8 Installation
Download java 1.8 either 32 or 64 bit according to your system configuration from oracle website and install.
If Java 1.8 already installed then leave this step.
Apache Kafka Installation
Download Apache Kafka from the apache website. In this article, I am going to show kafka_2.11-2.3.0.
It is not having any .exe file for windows, it is a packaged zip file, once download the zip file, unzip it.
Before going to start apache Kafka, we need to download Zookeeper.
Zookeeper Installation
Download Zookeeper from the apache website. in this article, I am going to show zookeeper-3.4.14.
It’s also not having any .exe file for windows, it’s a packaged zip file, once download the zip file, unzip it.
Before going to start the Apache Kafka server, you need to start Zookeeper first.
Zookeeper Server Start
Windows
Go to ->zookeeper-3.4.14 -> bin
zkServer.cmd
Linux/Unix
Go to ->zookeeper-3.4.14 -> bin
zkServer.sh
Apache Kafka Server Start
Windows
Go to -> kafka_2.11-2.3.0 -> bin > windows
We need to pass the server.properties file as command line argument
kafka-server-start.bat ..\..\config\server.properties
Linux/Unix
Go to -> kafka_2.11-2.3.0 -> bin
We need to pass the server.properties file as command line argument
kafka-server-start.sh ../../config/server.properties
How to create the Topic?
Syntax
kafka-topics.bat –zookeeper <zookeeper-ip>:<port> –create –topic <Topic Name>
Windows
kafka-topics.bat –zookeeper localhost:2181 –create –topic MyFirstTopic1
Linux/Unix
kafka-topics.sh –zookeeper localhost:2181 –create –topic MyFirstTopic1
Hello! I am Narayanaswamy founder and admin of narayanatutorial.com. I have been working in the IT industry for more than 12 years. NarayanaTutorial is my web technologies blog. My specialties are Java / J2EE, Spring, Hibernate, Struts, Webservices, PHP, Oracle, MySQL, SQLServer, Web Hosting, Website Development, and IAM(ForgeRock) Specialist
I am a self-learner and passionate about training and writing. I am always trying my best to share my knowledge through my blog.