ZooKeeper-less Raft Metadata Mode Initialization
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.
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.
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.
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.
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
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
Use the quick-action buttons in the sandbox to auto-fill commands, or type them manually into the terminal!