Big Data 4 min read

Step-by-Step Guide to Installing and Using Apache Kafka 3.8.1 on Linux

This tutorial walks through downloading, extracting, configuring, starting, creating topics, producing and consuming messages, and finally stopping Apache Kafka 3.8.1 on a Linux system, including all necessary command‑line instructions.

Full-Stack Internet Architecture
Full-Stack Internet Architecture
Full-Stack Internet Architecture
Step-by-Step Guide to Installing and Using Apache Kafka 3.8.1 on Linux

Welcome to the "Internet Full Stack Architecture" public account; today's quote is "Take it slow, it's faster."

Installing Kafka is straightforward: download the binary package, extract it, and start the services; the tutorial uses version 3.8.1.

1. Download the Kafka tarball and extract it to /usr/local :

wget https://dlcdn.apache.org/kafka/3.8.1/kafka_2.13-3.8.1.tgz
 tar -xzf kafka_2.13-3.8.1.tgz

2. Change to the Kafka installation directory ( /usr/local/kafka_2.13-3.8.1 ) and verify the version:

cd kafka_2.13-3.8.1
 bin/kafka-topics.sh --version
3.8.1

3. Start Kafka (after installing and starting Zookeeper on the same machine):

bin/kafka-server-start.sh config/server.properties &

Kafka now runs; although version 3.8.1 can operate without Zookeeper, this guide follows the Zookeeper‑based setup.

4. Create a topic named fullstack and display its details to confirm creation:

bin/kafka-topics.sh --create --topic fullstack --bootstrap-server localhost:9092
bin/kafka-topics.sh --describe --topic fullstack --bootstrap-server localhost:9092

5. Send two messages to the fullstack topic:

bin/kafka-console-producer.sh --topic fullstack --bootstrap-server localhost:9092
>helloooooooooooo
>wordddddddddddd

6. In another terminal, consume messages from the fullstack topic:

bin/kafka-console-consumer.sh --topic fullstack --from-beginning --bootstrap-server localhost:9092
helloooooooooooo
wordddddddddddd

The consumer displays the sent messages, confirming successful production and consumption.

7. To stop Kafka, run:

bin/kafka-server-stop.sh config/server.properties
big dataKafkaLinuxMessage Queuecommand lineInstallation
Full-Stack Internet Architecture
Written by

Full-Stack Internet Architecture

Introducing full-stack Internet architecture technologies centered on Java

0 followers
Reader feedback

How this landed with the community

login Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.