1:Redis的下载路径https://redis.io/download
2:先将下载好的Redis上传到你的虚虚拟机
3:解压Redis(tar -zxvf 下载的.tar.gz安装包 -C 解压到的路径)
4:解压完之后进入到解压路径用make命令编译Redis
编译过程中可能遇见的错误:
1: cc: command not found 说明缺少gcc,通过yum install gcc安装
2:error: jemalloc/jemalloc.h: No such file or directory 缺少jemalloc因为Redis默认的分配器是jemalloc
可以通过手动指定libc分配器的方式编译make MALLOC=libc
4:安装Redis 通过命令make PREFIX=安装路径 install
5:安装完进入安装目录的bin目录下
total 4560
-rwxr-xr-x. 1 root root 220936 Dec 14 03:33 redis-benchmark
-rwxr-xr-x. 1 root root 16463 Dec 14 03:33 redis-check-aof
-rwxr-xr-x. 1 root root 2046153 Dec 14 03:33 redis-check-rdb
-rwxr-xr-x. 1 root root 328273 Dec 14 03:33 redis-cli
lrwxrwxrwx. 1 root root 12 Dec 14 03:33 redis-sentinel -> redis-server
-rwxr-xr-x. 1 root root 2046153 Dec 14 03:33 redis-server