当前位置: 首页 > article >正文

kafak最新安装教程【kafka_2.13-3.9.0】双语版

Step 1: Get Kafka 第 1 步:获取 Kafka

Download the latest Kafka release and extract it:
下载最新的 Kafka 版本并提取它:

$ tar -xzf kafka_2.13-3.9.0.tgz
$ cd kafka_2.13-3.9.0

Step 2: Start the Kafka environment

第 2 步:启动 Kafka 环境
NOTE: Your local environment must have Java 8+ installed.
注意:您的本地环境必须安装 Java 8+。

Apache Kafka can be started using KRaft or ZooKeeper. To get started with either configuration follow one of the sections below but not both.
Apache Kafka 可以使用 KRaft 或 ZooKeeper 启动。要开始使用任一配置,请遵循以下部分之一,但不能同时执行这两部分。

Kafka with KRaft 带有 KRaft 的 Kafka
Kafka can be run using KRaft mode using local scripts and downloaded files or the docker image. Follow one of the sections below but not both to start the kafka server.
Kafka 可以使用本地脚本和下载的文件或 docker 镜像通过 KRaft 模式运行。按照以下部分之一(但不能同时执行)作启动 Kafka 服务器。

Using downloaded files 使用下载的文件
Generate a Cluster UUID 生成集群 UUID

$ KAFKA_CLUSTER_ID="$(bin/kafka-storage.sh random-uuid)"

Format Log Directories 设置日志目录的格式

$ bin/kafka-storage.sh format --standalone -t $KAFKA_CLUSTER_ID -c config/kraft/reconfig-server.properties

Start the Kafka Server 启动 Kafka 服务器

$ bin/kafka-server-start.sh config/kraft/reconfig-server.properties

Once the Kafka server has successfully launched, you will have a basic Kafka environment running and ready to use.
成功启动 Kafka 服务器后,您将有一个基本的 Kafka 环境运行并可供使用。

Using JVM Based Apache Kafka Docker Image
使用基于 JVM 的 Apache Kafka Docker 镜像
Get the Docker image: 获取 Docker 镜像:

$ docker pull apache/kafka:3.9.0

Start the Kafka Docker container:
启动 Kafka Docker 容器:

$ docker run -p 9092:9092 apache/kafka:3.9.0

Using GraalVM Based Native Apache Kafka Docker Image
使用基于 GraalVM 的原生 Apache Kafka Docker 镜像
Get the Docker image: 获取 Docker 镜像:

$ docker pull apache/kafka-native:3.9.0

Start the Kafka Docker container:
启动 Kafka Docker 容器:

$ docker run -p 9092:9092 apache/kafka-native:3.9.0

Kafka with ZooKeeper 带有 ZooKeeper 的 Kafka
Run the following commands in order to start all services in the correct order:
运行以下命令以按正确顺序启动所有服务:

Start the ZooKeeper service

$ bin/zookeeper-server-start.sh config/zookeeper.properties

Open another terminal session and run:
打开另一个终端会话并运行:

Start the Kafka broker service

$ bin/kafka-server-start.sh co

http://www.kler.cn/a/538657.html

相关文章:

  • Spring AI -使用Spring快速开发ChatGPT应用
  • Intellij IDEA如何查看当前文件的类
  • 【含文档+PPT+源码】基于Python校园跑腿管理系统设计与实现
  • SQL最佳实践(笔记)
  • 【RocketMQ 存储】- 同步刷盘和异步刷盘
  • 【3分钟极速部署】在本地快速部署deepseek
  • 电商行业的新篇章:3D和AR技术助力销售转化率提升!
  • 基于html和vue.js以及其他编程技术打造一个仿京东购物网站平台
  • c++学习笔记——c++基础
  • 【DeepSeek】DeepSeek概述 | 本地部署deepseek
  • Day81:数据的保存
  • Thinkpad T480s/X1c 2018 Manjaro Sway(ArchLinux)安装指纹(ID 06cb:009a)
  • 【C语言标准库函数】三角函数
  • 基于SpringBoot的巡游出租管理系统
  • 2025年最新版武书连SCD期刊(中国科学引文数据库)来源期刊已更新,可下载PDF版!需要的作者进来了解~
  • MySQL 数据库编程-C++
  • 消费电子产品中的噪声对TPS54202的影响
  • DeepSeek 与网络安全:AI 驱动的智能防御
  • go数据结构学习笔记
  • Flink 调用海豚调度器 SQL 脚本实现1份SQL流批一体化的方案和可运行的代码实例
  • COBOL语言的区块链
  • 使用 Python-pptx 库提取 PPTX 文件中的结构与文字
  • 关于Redis的持久化
  • 系统URL整合系列视频三(前端代码实现)
  • Spring Boot: 使用 @Transactional 和 TransactionSynchronization 在事务提交后发送消息到 MQ
  • c++ template-3