dns

Experiment 1: Single-Node KRaft Broker Setup

ZooKeeper-less Raft Metadata Mode Initialization

arrow_back Back to Experiments
Kafka Core Fundamentals

Standalone KRaft Cluster

Prior to Apache Kafka 3.x / 4.x, external ZooKeeper clusters managed metadata and controller elections. KRaft (KIP-500) integrates consensus directly within Kafka brokers via an internal @metadata topic, eliminating ZooKeeper entirely.

flag Aim

Configure environment variables (JAVA_HOME, KAFKA_HOME), generate a unique cluster UUID, format metadata log storage using kafka-storage.bat, and start a standalone KRaft broker.

architecture Theory: The KRaft Architecture

In traditional Kafka, a separate ZooKeeper cluster manages metadata. With KRaft, Kafka brokers use a Raft consensus protocol to maintain metadata internally within a special @metadata topic. This massively simplifies deployment and speeds up controller failover.

Kafka KRaft Broker
hub KRaft Controller
@metadata log
database Data Plane
Topic Partitions
Self-managed metadata (No ZooKeeper required)

checklist Mission Milestones

0 / 3 Done
radio_button_unchecked 1. Generate a Cluster UUID
radio_button_unchecked 2. Format the Storage Directory
radio_button_unchecked 3. Start the KRaft Broker

format_list_numbered Step-by-Step Commands

1

Generate Cluster UUID

Kafka requires a unique identifier for the cluster. This replaces ZooKeeper's cluster ID generation.

kafka-storage.bat random-uuid

Copy the UUID output — you'll need it in Step 2.

2

Format Log Directories

Format the data directory (defined in server.properties) using the UUID you just generated.

kafka-storage.bat format -t <UUID> -c config\server.properties
3

Start the Server

Boot up the KRaft broker. Watch the terminal logs to verify the controller quorum election.

kafka-server-start.bat config\server.properties
lightbulb

Use the quick-action buttons in the sandbox to auto-fill commands, or type them manually into the terminal!

Machine 1 — KRaft Broker (192.168.1.10)
Offline
Microsoft Windows [Version 10.0.19045.3803]
(c) Microsoft Corporation. All rights reserved.
Ready for Kafka KRaft storage initialization and broker boot.
Tip: Use the quick-action buttons below or type commands manually!
C:\kafka4.3.1>