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

How to install Apache Kafka on Rocky Linux?

王林
王林forward
2024-03-01 22:37:33871browse

如何在 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
  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
  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 

Unzip the downloaded compressed package:

tar -xzf kafka_2.13-2.8.0.tgz
  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

Make the configuration effective:

source ~/.bashrc
  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
  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

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!

Statement:
This article is reproduced at:mryunwei.com. If there is any infringement, please contact admin@php.cn delete