What is Apache Kafka(2021) | CodeUsingJava

Installation of Apache Kafka(2021)

As I discussed in the previous tutorial, Apache Kafka has several components and its architecture. Here, in the next tutorial, we will see how to install Kafka and related tools.
It is assumed that you have jdk installed in your system with proper memory location provided in the System variable named PATH.
Before installing the kafka, we need to update the System Variable named PATH variable by adding the following locations:-
C:\Windows\System32\wbem.If we do not update the PATH variable, we may get the following error-
wmic is not recognized as an internal or external command.

Installation of Kafka

Go to the official downloads page of Apache Kafka kafka.apache.org and download the latest version of kafka.
We see that the zip file of the latest version gets downloaded. Now extract and unzip the file to a particular location wherever we want. We can rename the folder name to kafka.
The file after extracting would be as follows-
Architecture of kafka
We can copy the path of kafka inside config -> server.properties file inside the logs command.
kafka path
Similarly, the path for logs inside the zookeeper.properties file can be updated-
kafka path
The installation of kafka has a predefined zookeeper installed which is used for the purpose of coordination and management of message stream like tracking kafka topics, clusters and many more..
We start the zookeeper service by the following command-
.\bin\windows\zookeeper-server-start.bat .\config\zookeeper.properties
zookeeper install

Starting the Apache Kafka

We open another command prompt and then start the Kafka broker by the following command-
.\bin\windows\kafka-server-start.bat .\config\server.properties
We can see the default port i.e 9092 in the command logs.
kafka  install

Install the Graphical User Interface of the Kafka tool

kafkatool is also known as the offset explorer. We go to the following url to install the kafka tool according to the operating system-
An exe file is installed in our system. We must install the offset explorer on our system.
kafka gui

The following wizard opens at the screen. Now click on next.
kafka gui 2

Accept the terms and conditions-
kafka gui 3

Now the setup is installed in our system.
kafka gui 4

Now open the offset explorer and click on OK to configure the connections.
kafka gui 5

We can also add the clusters in the following manner-
kafka gui 6

kafka gui 8