1、redis下载
地址:http://download.redis.io/releases/
注:本文档以4.0.0为例
2、安装gcc
yum install gcc gcc-c++
3、编译安装
cd redis-4.0.0 make MALLOC=libc make PREFIX=/usr/local/redis install
4、拷贝配置文件到安装目录
mkdir /usr/local/redis/conf cd redis-4.0.0 cp redis.conf /usr/local/redis/conf
5、修改配置
1)把daemonize改为yes (以后端模式启动redis)
6、将/usr/local/redis/bin加入环境变量
echo ‘ export PATH=$PATH:/usr/local/redis/bin‘>>/etc/profile
7、以后端模式启动redis
redis-server /usr/local/redis/conf/redis.conf