1.首先下载redis-5.0.7.tar.gz,官网直接下载或者wget都可以。
2.下载解压tar zxvf redis-5.0.7.tar.gz
3.进入解压后的文件夹,cd redis-5.0.7
4.给与全部文件执行权限chmod 777 */*
5.当前目录执行make
6.当前目录执行make test,报错,You need tcl 8.5 or newer in order to run the Redis test
安装tcl:
wget http://downloads.sourceforge.net/tcl/tcl8.6.1-src.tar.gz
tar xzvf tcl8.6.1-src.tar.gz
cd ./tcl8.6.1/unix/
./configure
make
make install
继续执行make test
6.指定目录安装make install PREFIX=/root/redis
7.cd /root/redis/bin
8../redis-server运行redis
9.更改redis为后台运行
cp /root/redis-5.0.7/redis.conf /root/redis/bin
vi /root/redis/bin/redis.conf
搜索
/daemonize
找到后将no 改为yes
保存退出
cd /root/redis/bin
./redis-server ./redis.conf运行即可