小樱 发表于 2024/11/29 18:30

linux centos9 kangle 3.6.0源代码cmake编译官方教程 启用iouring网络模型

linux centos9 kangle 3.6.0源代码cmake编译官方教程 启用iouring网络模型

也可以参考我自己发的教程
https://bbs.itzmx.com/thread-109515-1-1.html

以下是官方教程
升级内核,因为要启用高性能的iouring(比epoll高很多),必须要升级linux内核
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
yum install https://www.elrepo.org/elrepo-release-9.el9.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-lt
升级完后重起,uname -r 看是否成功(6.1以上).

安装依赖
yum -y install git gcc gcc-c++ zlib-devel sqlite-devel openssl-devel pcre-devel brotli-devel cmake

安装liburing

wget https://github.com/axboe/liburing/archive/refs/tags/liburing-2.8.tar.gz
tar xzf liburing-2.8.tar.gz
cd liburing-liburing-2.8
./configure
make
make install
echo "/usr/lib" > /etc/ld.so.conf.d/usr_lib.conf
cd ..
安装jemalloc
yum -y install autoconf automake
wget https://github.com/jemalloc/jemalloc/archive/refs/tags/5.3.0.tar.gz -O jemalloc-5.3.0.tar.gz
tar xzf jemalloc-5.3.0.tar.gz
cd jemalloc-5.3.0
./autogen.sh
make
make install
echo "/usr/local/lib" > /etc/ld.so.conf.d/usr_local_lib.conf
cd ..
安装kangle,其中v3.6.0是发行版本,你可以选择最新稳定版本号替换.
git clone -b v3.6.0 https://gitee.com/keengo/kangle
cd kangle
git submodule init
git submodule update
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE=Release -DLINUX_IOURING=ON -DENABLE_BROTLI=1 -DENABLE_JEMALLOC=1 -DCMAKE_INSTALL_PREFIX=/vhs/kangle
make
make install
ldconfig
运行 /vhs/kangle/bin/kangle -v
看是否成功.

官方wiki的centos9编译教程
https://gitee.com/keengo/kangle/wikis/%E5%AE%89%E8%A3%85%E6%95%99%E7%A8%8B/centos%209%20%E5%AE%89%E8%A3%85kangle%E6%95%99%E7%A8%8B

页: [1]
查看完整版本: linux centos9 kangle 3.6.0源代码cmake编译官方教程 启用iouring网络模型