ANGADJAVA Dev Blog,Tech Blog Getting Started with Kafka: Installing Apache Kafka

Getting Started with Kafka: Installing Apache Kafka

2 Comments 7:36 pm

apache kafka

Apache Kafka is a distributed streaming platform that is used to build real-time streaming data pipelines and applications. In this tutorial, we will learn how to install Apache Kafka on a Windows system.

Prerequisites

Before we begin, ensure that you have the following prerequisites:

  • Windows operating system
  • Java 8 or higher installed on your system
  • Administrative access to install software on your system

Step 1: Download Apache Kafka

Go to the official Apache Kafka website and download the latest version of Apache Kafka. Once the download is complete, extract the files to a directory of your choice.

Step 2: Configure Apache Kafka

Navigate to the extracted directory and open the config folder. Open the server.properties file and make the following changes:

  • listeners=PLAINTEXT://localhost:9092
  • advertised.listeners=PLAINTEXT://localhost:9092

Save and close the server.properties file.

Step 3: Start Apache Kafka

Open a command prompt and navigate to the bin/windows directory. Run the zookeeper-server-start.bat file to start the Zookeeper server.

Open another command prompt and navigate to the same bin/windows directory. Run the kafka-server-start.bat file to start the Kafka server.

Apache Kafka is now installed and running on your Windows system.

Installing Apache Kafka on Linux

In this tutorial, we will learn how to install Apache Kafka on a Linux system.

Prerequisites

Before we begin, ensure that you have the following prerequisites:

  • Linux operating system
  • Java 8 or higher installed on your system
  • Administrative access to install software on your system

Step 1: Install Java

Open a terminal window and run the following command to update the package list:

sudo apt-get update

Install Java by running the following command:

sudo apt-get install default-jdk

Step 2: Download Apache Kafka

Go to the official Apache Kafka website and download the latest version of Apache Kafka. Once the download is complete, extract the files to a directory of your choice.

Step 3: Configure Apache Kafka

Navigate to the extracted directory and open the config folder. Open the server.properties file and make the following changes:

  • listeners=PLAINTEXT://localhost:9092
  • advertised.listeners=PLAINTEXT://localhost:9092

Save and close the server.properties file.

Step 4: Start Apache Kafka

Open a new terminal window and navigate to the extracted directory. Run the following command to start the Zookeeper server:

bin/zookeeper-server-start.sh config/zookeeper.properties

Open another terminal window and navigate to the same extracted directory. Run the following command to start the Kafka server:

bin/kafka-server-start.sh config/server.properties

Apache Kafka is now installed and running on your Linux system.

2 thoughts on “Getting Started with Kafka: Installing Apache Kafka”

Leave a Reply

Your email address will not be published. Required fields are marked *