DEV Community

sh3hz
sh3hz

Posted on

Apache Kafka: Quickstart: Binary Deployment in Windows

Introduction

Windows installation guide for https://kafka.apache.org/quickstart

Step 1: Downloading the Application

Image description

Step 2: Installation

  • Extract the Downloaded file (.tgz) with any file archiver like 7zip
  • After extracting you'll get a TAR File (.tar), Again extract the TAR file.

Image description

Step 3: Configuration

  • Update server.properties

    • Create new Directory - C:\tmp\kafka-logs
    • Update log.dirs=C:\tmp\kafka-logs
  • Update zookeeper.properties

    • Create new Directory - C:\tmp\zookeeper
    • Update _*dataDir*=C:\tmp\zookeeper_

Step 4: Running the Kafka Application

Kafka with ZooKeeper

  • Start Zookeeper Server

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

Image description

Image description

  • Start Kafka Server

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

Image description

Image description

Step 5: Create Topic

  • Topic name: quickstart-events

.\bin\windows\kafka-topics.bat --create --topic quickstart-events --bootstrap-server localhost:9092

Image description

Image description

Step 6: Producer: Write some events to topic

.\bin\windows\kafka-console-producer.bat --topic quickstart-events --bootstrap-server localhost:9092

Image description

Step 7: Consumer: Read the events

.\bin\windows\kafka-console-consumer.bat --topic quickstart-events --from-beginning --bootstrap-server localhost:9092

Image description

Step 8: Stream messages

  • Add a message in Producer console from Step 6

Image description

  • Message is streamed to the Consumer console from Step 7

Image description

Top comments (0)