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. 保留所有權利。 本軟體為專有軟體,不得轉發或共享。