1.下载tar包
wget http://download.redis.io/releases/redis-5.0.5.tar.gz
解压 tar -xvf redis-5.0.5.tar.gz
cd redis-5.0.5/
2.编译源文件
编译测试 make test
最小安装服务器可能会报错:
-bash: make: command not found
安装对应服务
yum -y install gcc automake autoconf libtool make
yum install gcc gcc-c++
报出信息:You need tcl 8.5 or newer in order to run the Redis test
安装tcl
wget https://sourceforge.net/projects/tcl/files/Tcl/8.6.9/tcl8.6.9-src.tar.gz
tar -zxvf tcl8.6.9-src.tar.gz
cd tcl8.6.9/unix
./configure
make
make install
返回redis-5.0.5目录
重新执行 make test
编译 make
安装 make PREFIX=/usr/local/redis install (安装到指定目录)

3.配置启动
cp redis.conf /usr/local/redis
cd /usr/local/redis/
mkdir log
编辑redis.conf
vim redis.conf
1.后台启动,daemonize yes
2.绑定IP,bind 192.168.XX.XXX
3.数据存放路径,dir /usr/local/redis/log rdb存放的路径
4.指定持久化方式,appendonly yes
启动: ./bin/redis-server ./redis.conf
66790:C 11 Oct 2019 12:06:06.029 # oO0OoO0OoO0Oo Redis is starting oO0OoO0OoO0Oo
66790:C 11 Oct 2019 12:06:06.029 # Redis version=5.0.5, bits=64, commit=00000000, modified=0, pid=66790, just started
66790:C 11 Oct 2019 12:06:06.029 # Configuration loaded
查看是否启动成功:
ps aux | grep redis
转载:https://www.jianshu.com/p/77f6415a0d39