lua-resty-kafka-fast

配置二进制安装包仓库

首先,我们需要使用下面的命令配置软件的仓库。(命令中的“CLIENT_TOKEN”需要替换为订阅电子邮件中的有效令牌)

curl -o get-xray-priv-lib-repo.sh https://pkg2.openresty.com/scripts/get-xray-priv-lib-repo.sh
sudo bash get-xray-priv-lib-repo.sh -l openresty-priv-comm -t CLIENT_TOKEN
sudo bash get-xray-priv-lib-repo.sh -l lua-resty-kafka-fast -t CLIENT_TOKEN

安装

适用于 OpenResty-1.21.4.x

对于使用 yum 作为软件包管理器的 CentOS/RockyLinux/Amazon Linux/Alibaba Cloud Linux/Tecent Linux 操作系统,执行以下命令安装私有库。

sudo yum makecache
sudo yum install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.21.4

对于使用 dnf 作为软件包管理器的 Fedora 等操作系统,执行以下命令安装私有库。

sudo dnf makecache
sudo dnf install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.21.4

对于使用apt作为软件包管理器的操作系统,如Ubuntu/Debian,运行以下命令安装私有库。

sudo apt-get update
sudo apt-get install -y lua-kafka-nginx-module-1.21.4

适用于 OpenResty 1.25.3.x

对于使用 yum 作为软件包管理器的 CentOS/RockyLinux/Amazon Linux/Alibaba Cloud Linux/Tecent Linux 操作系统,执行以下命令安装私有库。

sudo yum makecache
sudo yum install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.25.3

对于使用 dnf 作为软件包管理器的操作系统(如 Fedora ),执行以下命令安装私有库。

sudo dnf makecache
sudo dnf install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.25.3

对于使用apt作为软件包管理器的操作系统,如Ubuntu/Debian,运行以下命令安装私有库。

sudo apt-get update
sudo apt-get install -y lua-kafka-nginx-module-1.25.3

适用于 OpenResty 1.27.1.x

对于使用 yum 作为软件包管理器的 CentOS/RockyLinux/Amazon Linux/Alibaba Cloud Linux/Tecent Linux 操作系统,执行以下命令安装私有库。

sudo yum makecache
sudo yum install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.27.1

对于使用 dnf 作为软件包管理器的操作系统(如 Fedora ),执行以下命令安装私有库。

sudo dnf makecache
sudo dnf install --disablerepo="*" --enablerepo=lua-resty-kafka-fast --enablerepo=openresty-priv-comm -y lua-kafka-nginx-module-1.27.1

对于使用apt作为软件包管理器的操作系统,如Ubuntu/Debian,运行以下命令安装私有库。

sudo apt-get update
sudo apt-get install -y lua-kafka-nginx-module-1.27.1

安装 OpenResty

按照 https://openresty.org/en/linux-packages.html 这个文档配置 openresty 的仓库。

比如,对于 yum 作为包管理器的系统,想要安装 1.25.3 的 OpenResty:

$ yum list --showduplicates openresty
Last metadata expiration check: 0:07:22 ago on Sat 13 Sep 2025 07:15:05 AM CST.
Available Packages
openresty.x86_64                                                      1.21.4.4-1.el9                                                      openresty
openresty.x86_64                                                      1.25.3.2-1.el9                                                      openresty
openresty.x86_64                                                      1.27.1.2-1.el9                                                      openresty
$ sudo yum install openresty-1.25.3.2-1.el9

比如,对于 dnf 作为包管理器的系统,想要安装 1.25.3 的 OpenResty:

$ dnf list --showduplicates openresty
Last metadata expiration check: 0:07:22 ago on Sat 13 Sep 2025 07:15:05 AM CST.
Available Packages
openresty.x86_64                                                      1.21.4.4-1.el9                                                      openresty
openresty.x86_64                                                      1.25.3.2-1.el9                                                      openresty
openresty.x86_64                                                      1.27.1.2-1.el9                                                      openresty
$ sudo dnf install openresty-1.25.3.2-1.el9

对于使用 apt 作为包的理器的系统,安装 openresty 1.25.3 的 OpenResty:

$ apt-cache madison openresty
 openresty | 1.27.1.2-1~noble1 | https://openresty.org/package/ubuntu noble/main amd64 Packages
 openresty | 1.27.1.1-1~noble1 | https://openresty.org/package/ubuntu noble/main amd64 Packages
 openresty | 1.25.3.2-2~noble1 | https://openresty.org/package/ubuntu noble/main amd64 Packages

$ sudo apt install openresty=1.25.3.2-2~noble1

使用方法

更多详情,请参阅 lua-resty-kafka-fast

基准

在英特尔(R)至强(R)CPU E5-2680 v4 @ 2.40GHz 上,每个 Worker 每秒可消费 40,000 条信息。

版权与许可

Copyright (C) 2024 OpenResty Inc. 保留所有权利。 本软件为专有软件,不得转发或共享。