Redis手动编译
1、编译环境
硬件环境:香橙派5 aarch64架构
软件环境:Ubuntu 22.04.3 LTS
编译版本:redis-6.2.6
2、编译操作
(1)、获取源码包
#更新软件包,安装编译依赖
apt update
apt install build-essential tcl -y
wget http://download.redis.io/releases/redis-6.2.6.tar.gz
tar -xzf redis-6.2.6.tar.gz
cd redis-6.2.6
(2)编译安装
#编译
make
#多线程编译
make -j 线程数
#安装
make install
#指定目录安装
make PREFIX=/data/make_test/redis_for_make/redis install
#创建配置文件目录,复制配置文件到安装目录
mkdir -p /data/make_test/redis_for_make/redis/etc/
cp /data/make_test/redis_for_make/redis-6.2.6/redis.conf /data/make_test/redis_for_make/redis/etc/
(3)、启动
cd /data/make_test/redis_for_make/redis/bin
./redis-server ../etc/redis.conf
1956753:C 07 May 2025 20:03:33.242 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
1956753:C 07 May 2025 20:03:33.242 # Redis version=6.2.6, bits=64, commit=00000000, modified=0, pid=1956753, just started
1956753:C 07 May 2025 20:03:33.242 # Configuration loaded
1956753:M 07 May 2025 20:03:33.242 * Increased maximum number of open files to 10032 (it was originally set to 1024).
1956753:M 07 May 2025 20:03:33.242 * monotonic clock: POSIX clock_gettime
_._
_.-``__ ''-._
_.-`` `. `_. ''-._ Redis 6.2.6 (00000000/0) 64 bit
.-`` .-```. ```\/ _.,_ ''-._
( ' , .-` | `, ) Running in standalone mode
|`-._`-...-` __...-.``-._|'` _.-'| Port: 6379
| `-._ `._ / _.-' | PID: 1956753
`-._ `-._ `-./ _.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' | https://redis.io
`-._ `-._`-.__.-'_.-' _.-'
|`-._`-._ `-.__.-' _.-'_.-'|
| `-._`-._ _.-'_.-' |
`-._ `-._`-.__.-'_.-' _.-'
`-._ `-.__.-' _.-'
`-._ _.-'
`-.__.-'
1956753:M 07 May 2025 20:03:33.243 # Server initialized
1956753:M 07 May 2025 20:03:33.243 # WARNING overcommit_memory is set to 0! Background save may fail under low memory condition. To fix this issue add 'vm.overcommit_memory = 1' to /etc/sysctl.conf and then reboot or run the command 'sysctl vm.overcommit_memory=1' for this to take effect.
#测试
redis-cli
127.0.0.1:6379> set a 1
OK
127.0.0.1:6379> get a
"1"
247

被折叠的 条评论
为什么被折叠?



