#Redis开源相关命令记录
#环境
ubuntu
shellshell折叠展开
sudo apt-get updatesudo apt-get install -y --no-install-recommends pkg-config libjemalloc-dev git ca-certificates wget dpkg-dev gcc g++ libc6-dev libssl-dev make git cmake python3 python3-pip python3-venv python3-dev unzip rsync clang automake autoconf libtool tcl tcl-devcentos
shellshell折叠展开
dnf install sudo -ysudo dnf install jemalloc-devel -y#编译
bashbash折叠展开
# 以tls模式编译make BUILD_TLS=yes # 编译测试modulemake -C tests/modules/ # 32位编译make 32bit REDIS_CFLAGS='-Werror -DREDIS_TEST'#测试
bashbash折叠展开
# 执行单个测试./runtest --single "unit/moduleapi/scan" --only "Module scan hash dict" # linux上taskset执行taskset -c 0 ./runtest --single "unit/memefficiency" --only "Active defrag big keys: standalone" --loop --stop # CI忽略执行--skipunit unit/cluster/atomic-slot-migration # 执行单元测试make REDIS_CFLAGS='-Werror -DREDIS_TEST'./src/redis-server test all一次性执行全部redis-cli命令
可以新建 a.txt 文件:
shellshell折叠展开
flushallconfig set sanitize-dump-payload nodebug set-skip-checksum-validation 1 restore _hash 0 "\x10\x15\x15\x00\x00\x00\x06\x00\x00\x01\x00\x01\x01\x01\x82\x5F\x31\x4B\x02\x01\x02\x01\xFF\x0C\x00\x5F\x57\x3E\x3A\xFC\x78\x01\x0D" replace然后执行 $ cat a.txt| ./src/redis-cli 结果如下:
shellshell折叠展开
OKOKOK(error) ERR Bad data formatEND · 2026.02.04


