Skip to main content

Apache Kafka Installation Guide

This guide provides all the key information and getting-started instructions after a successful Apache Kafka installation via DeploySage-CLI. This installation uses the modern KRaft mode, which does not require ZooKeeper.

Service Management

Manage the Kafka service using standard systemctl commands.

# Start the Kafka service
sudo systemctl start kafka

# Stop the Kafka service
sudo systemctl stop kafka

# Restart the Kafka service
sudo systemctl restart kafka

# Check the service status
sudo systemctl status kafka

# View real-time logs
sudo journalctl -u kafka -f

Key Directories and Files

Understanding the file structure is essential for configuration and data management.

ItemValue
Kafka Home Directory/usr/local/kafka
KRaft Config File.../config/kraft/server.properties
Data/Log Directory/usr/local/kafka/logs
Service File/etc/systemd/system/kafka.service

Common Commands

Connection Information

Interact with your Kafka cluster using the command-line tools located in /usr/local/kafka/bin.

# Create a new topic
kafka-topics.sh --create --topic my-topic --bootstrap-server localhost:9092

# List all topics
kafka-topics.sh --list --bootstrap-server localhost:9092

# Start a console producer to send messages
kafka-console-producer.sh --topic my-topic --bootstrap-server localhost:9092

# Start a console consumer to read messages
kafka-console-consumer.sh --topic my-topic --from-beginning --bootstrap-server localhost:9092