一、下载安装包
[root@glusterfs03 ~]# wget https://download.redis.io/releases/redis-6.2.7.tar.gz --2022-10-18 10:35:21-- https://download.redis.io/releases/redis-6.2.7.tar.gz Resolving download.redis.io (download.redis.io)... 45.60.125.1 Connecting to download.redis.io (download.redis.io)|45.60.125.1|:443... connected. HTTP request sent, awaiting response... 200 OK Length: 2487287 (2.4M) [application/octet-stream] Saving to: ‘redis-6.2.7.tar.gz’ 100%[==========================================================================>] 2,487,287 3.12MB/s in 0.8s 2022-10-18 10:35:23 (3.12 MB/s) - ‘redis-6.2.7.tar.gz’ saved [2487287/2487287]
二、解压
[root@glusterfs03 ~]# tar zxvf redis-6.2.7.tar.gz
三、安装依赖包
yum install gcc -y
四、编译
[root@glusterfs03 redis-6.2.7]# make cd src && make all make[1]: Entering directory `/root/hlcc_v9.20220501_centos7_jd/redis-6.2.7/src' CC Makefile.dep make[1]: Leaving directory `/root/hlcc_v9.20220501_centos7_jd/redis-6.2.7/src' make[1]: Entering directory `/root/hlcc_v9.20220501_centos7_jd/redis-6.2.7/src' CC adlist.o In file included from adlist.c:34:0: zmalloc.h:50:31: fatal error: jemalloc/jemalloc.h: No such file or directory #include <jemalloc/jemalloc.h> ^
报错,清理前次编译
[root@glusterfs03 redis-6.2.7]# make distclean
[root@glusterfs03 redis-6.2.7]# make clean cd src && make clean
再次编译
Hint: It's a good idea to run 'make test' ;)
五、运行redis-server查看版本
[root@glusterfs03 redis-6.2.7]# src/redis-server --version Redis server v=6.2.7 sha=00000000:0 malloc=jemalloc-5.1.0 bits=64 build=e5367c6e71a1b196 [root@glusterfs03 redis-6.2.7]#
六、redis-server和redis-cli建立软连接
[root@glusterfs03 redis-6.2.7]# ln -f /home/hlcti/redis-6.2.7/src/redis-server /usr/bin/ [root@glusterfs03 redis-6.2.7]# ln -f /home/hlcti/redis-6.2.7/src/redis-cli /usr/bin/