Introduction

Apache Kafka is a distributed event streaming platform capable of handling trillions of events a day. It is commonly used for building real-time data pipelines and streaming applications. In this guide, you will learn how to install Apache Kafka on Rocky Linux, which can be effectively hosted on a Windows VPS UK for enhanced performance and reliability.

Prerequisites

  • A Rocky Linux server with root access
  • Java Development Kit (JDK) installed
  • Basic knowledge of Linux commands

Step 1: Update Your System

Start by updating your package index and upgrading existing packages:

sudo dnf update -y

Step 2: Install Java JDK

Apache Kafka requires Java, so install the OpenJDK package:

sudo dnf install java-11-openjdk-devel -y

Verify the Java installation:

java -version

Step 3: Download Apache Kafka

Download the latest version of Apache Kafka:

wget https://downloads.apache.org/kafka/3.5.0/kafka_2.13-3.5.0.tgz

Extract the downloaded archive:

tar -xzf kafka_2.13-3.5.0.tgz

Move the extracted Kafka folder to /usr/local:

sudo mv kafka_2.13-3.5.0 /usr/local/kafka

Step 4: Start Zookeeper

Kafka requires Zookeeper to manage distributed brokers. Start Zookeeper using the following command:

sudo /usr/local/kafka/bin/zookeeper-server-start.sh /usr/local/kafka/config/zookeeper.properties

Step 5: Start Kafka Server

Open another terminal session to start the Kafka server:

sudo /usr/local/kafka/bin/kafka-server-start.sh /usr/local/kafka/config/server.properties

Step 6: Create a Kafka Topic

Create a new Kafka topic called "test" using the following command:

sudo /usr/local/kafka/bin/kafka-topics.sh --create --topic test --bootstrap-server localhost:9092 --partitions 1 --replication-factor 1

Step 7: Test Kafka

To test your Kafka installation, open a producer terminal and send messages:

sudo /usr/local/kafka/bin/kafka-console-producer.sh --topic test --bootstrap-server localhost:9092

In another terminal, consume the messages:

sudo /usr/local/kafka/bin/kafka-console-consumer.sh --topic test --from-beginning --bootstrap-server localhost:9092

Step 8: Conclusion

You have successfully installed Apache Kafka on Rocky Linux. This powerful messaging platform can significantly benefit from being hosted on a Windows VPS. For additional options, explore various VPS UK Windows solutions, including Windows Virtual Private Server Hosting and Windows VPS Hosting UK for optimal performance and reliability.

© 2024 Apache Kafka Installation Tutorial. All rights reserved.

Hai trovato utile questa risposta? 0 Utenti hanno trovato utile questa risposta (0 Voti)