banner



How To Run Apache Kafka On Windows

In this post, we will look at the step-by-step procedure for Kafka Installation on Windows. Kafka is an open-source stream-processing software platform and comes nether the Apache software foundation.

What is Kafka?

Kafka is used for real-time streams of data, to collect big information, or to practise real-time analysis (or both). Kafka is used with in-memory microservices to provide durability and it tin can be used to feed events to complex event streaming systems and IoT/IFTTT-style automation systems.

Installation :

1. Java Setup:

Kafka requires Coffee 8 for running. And hence, this is the kickoff step that nosotros should do to install Kafka. To install Java, there are a couple of options. We can go for the Oracle JDK version 8 from the Official Oracle Website.

2. Kafka & Zookeeper Configuration:

Step i: Download Apache Kafka from its Official Site.

Step 2: Extract tgz via cmd or from the available tool to a location of your choice:

                          tar -xvzf kafka_2.12-2.4.ane.tgz                      

Footstep 3: Copy the path of the Kafka folder. Now go to config inside Kafka folder and open zookeeper.properties file. Copy the path against the field dataDir and add together /zookeeper-data to the path.

zookeeper Step 4: nosotros have to alter the config/server.properties file. Beneath is the change:

                          fileslog.dirs=C:\kafka\kafka-logs                      

Basically, we are pointing the log.dirs to the new folder /data/kafka.

Run Kafka Server:

Step one: Kafka requires Zookeeper to run. Basically, Kafka uses Zookeeper to manage the entire cluster and various brokers. Therefore, a running example of Zookeeper is a prerequisite to Kafka.

To start Zookeeper, we can open a PowerShell prompt and execute the below command:

                          .\bin\windows\zookeeper-server-showtime.bat .\config\zookeeper.properties                      

If the command is successful, Zookeeper will commencement on port 2181.

Step 2: Now open another command prompt and modify the directory to the kafka binder. Run kafka server using the command:

                          .\bin\windows\kafka-server-offset.bat .\config\server.properties                      

Now your Kafka Server is upward and running, y'all can create topics to shop messages. Likewise, we can produce or consume data straight from the command prompt.

Create a Kafka Topic:

  1. Open up a new command prompt in the location C:\kafka\bin\windows.
  2. Run the post-obit command:
                          kafka-topics.bat --create --zookeeper localhost:2181 --replication-factor 1 --partitions 1 --topic test                      

Creating Kafka Producer:

  1. Open a new command prompt in the location C:\kafka\bin\windows
  2. Run the post-obit control:
                          kafka-console-producer.bat --broker-listing localhost:9092 --topic exam                      

Creating Kafka Consumer:

  1. Open a new command prompt in the location C:\kafka\bin\windows.
  2. Run the following command:
                          kafka-console-consumer.bat --bootstrap-server localhost:9092 --topic test --from-start                      

If you see these messages on consumer panel,Congratulations!!! you all washed. And so you can play with producer and consumer terminal bypassing some Kafka messages.

Written by Ashish Sharma

Ashish is a software engineer who continually seeks make clean, elegant solutions to business challenges. His lifelong passion for technology drives him to proactively expand horizons, constantly exploring and evaluating new languages, platforms, frameworks and tools.

Source: https://www.loginradius.com/blog/engineering/quick-kafka-installation/

Posted by: shepardabse1969.blogspot.com

0 Response to "How To Run Apache Kafka On Windows"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel