Mark As Completed Discussion

Installing Kafka

To start using Kafka, you need to install it on your local machine. Follow the step-by-step guide below to install Kafka:

  1. Download Kafka:

    • Navigate to the Apache Kafka downloads page.
    • Download the latest stable version of Kafka by clicking the download link for your preferred operating system.
    • Save the downloaded file to a location on your computer.
  2. Extract Kafka:

    • Open a terminal or command prompt.
    • Navigate to the directory where you saved the downloaded Kafka file.
    • Extract the Kafka archive file using the appropriate command for your operating system.
      • For example, if you downloaded the .tgz file on Linux/macOS, use the following command:
        SNIPPET
        1tar -xzf kafka_<version>.tgz
      • If you downloaded the .zip file on Windows, right-click the file and select "Extract All..." to extract the contents.
  3. Start ZooKeeper:

    • Kafka requires ZooKeeper for coordination.
    • Open a new terminal or command prompt.
    • Navigate to the Kafka installation directory.
    • Run the following command to start ZooKeeper:
      SNIPPET
      1bin/zookeeper-server-start.sh config/zookeeper.properties
  4. Start Kafka:

    • Open another terminal or command prompt.
    • Navigate to the Kafka installation directory.
    • Run the following command to start Kafka:
      SNIPPET
      1bin/kafka-server-start.sh config/server.properties

Congratulations! You have successfully installed Kafka on your local machine. You can now start using Kafka for building real-time streaming applications.

JAVA
OUTPUT
:001 > Cmd/Ctrl-Enter to run, Cmd/Ctrl-/ to comment