Home > Computer Tutorials > Computer Knowledge > How to install Apache Kafka on Rocky Linux?

How to install Apache Kafka on Rocky Linux?

王林
Release: 2024-03-01 22:37:33
forward
868 people have browsed it

如何在 Rocky Linux 上安装 Apache Kafka?

To install Apache Kafka on Rocky Linux, you can follow the steps below:

  1. Update system: First, make sure your Rocky Linux system is up to date and execute the following command to update the system software package:
sudo yum update
Copy after login
  1. Install Java: Apache Kafka depends on Java, so you need to install Java Development Kit (JDK) first. OpenJDK can be installed via the following command:
sudo yum install java-1.8.0-openjdk-devel
Copy after login
  1. Download and decompress: Visit Apache Kafka official website (

    ) Download the latest binary package. Choose a stable version and download the compressed package, for example:

wget 
Copy after login

Unzip the downloaded compressed package:

tar -xzf kafka_2.13-2.8.0.tgz
Copy after login
  1. Configure environment variables: Edit
    ~/.bashrc file and add the following lines to set the Kafka installation directory:
export KAFKA_HOME=/path/to/kafka_2.13-2.8.0export PATH=$PATH:$KAFKA_HOME/bin
Copy after login

Make the configuration effective:

source ~/.bashrc
Copy after login
  1. Start Zookeeper: Kafka depends on Zookeeper, so the Zookeeper server needs to be started. Enter the Kafka installation directory and execute the following command:
cd $KAFKA_HOMEbin/zookeeper-server-start.sh config/zookeeper.properties
Copy after login
  1. Start the Kafka server: In another terminal window, enter the Kafka installation directory and execute the following command to start the Kafka server:
cd $KAFKA_HOMEbin/kafka-server-start.sh config/server.properties
Copy after login

At this point, you have successfully installed and started Apache Kafka. You can continue to configure and use Kafka to create topics, produce and consume messages, etc. Please note that the above steps only cover the basic installation and startup of Kafka. For specific configuration and usage, please refer to the official Apache Kafka documentation and related resources for more detailed instructions and examples.

The above is the detailed content of How to install Apache Kafka on Rocky Linux?. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:mryunwei.com
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template