Site icon Narayana Tutorial

Apache Kafka Zookeeper Setup In Windows and Linux

Apache-Kafka-Installation-on-Windows-Linux-Unix

Apache-Kafka-Installation-on-Windows-Linux-Unix

Apache Kafka Zookeeper Setup In Windows and Linux

 

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

  1. Java 1.8
  2. Apache Kafka
  3. 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.

Apache-Kafka-Softwares

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