How to Install Apache Kafka on Rocky Linux

 

 

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.

  • 0 Korisnici koji smatraju članak korisnim
Je li Vam ovaj odgovor pomogao?

Vezani članci

Boost Your Ubuntu System's Performance with a Swap File: A Step-by-Step Guide

What is a Swap File? A swap file in Ubuntu serves as dedicated virtual memory on your hard...

How to Migrate ISPConfig 2, ISPConfig 3.x, Confixx, CPanel or Plesk to ISPConfig 3.2 (single server)

Introduction Migration from other control panels like ISPConfig 2, ISPConfig 3.x, Confixx,...

How to Install and Configure Zabbix Server and Client on Rocky Linux 9

Introduction Zabbix is an open-source monitoring solution that provides real-time...

How to Install CockroachDB Cluster on Debian 12

Introduction CockroachDB is a distributed SQL database built to handle large-scale,...

How to Install Joomla with Apache and Let's Encrypt SSL on AlmaLinux 9

Introduction Joomla is a popular open-source content management system (CMS) used to build...