1. 在 Redis 官网 下载 Redis
wget http://download.redis.io/releases/redis-5.0.6.tar.gz
2. 解压 redis-5.0.6.tar.gz 压缩包
tar -vxzf redis-5.0.6.tar.gz
3. 进入 reids-5.0.6 目录,编译
cd ./redis-5.0.6
make
4. 从默认配置文件复制出自定义的配置文件
cp ./redis.conf /etc/redis/redis.conf
5. 修改配置文件
- 开启远程访问:注释
bind 127.0.0.1
,将protected-mode yes
修改为protected-mode no
。 - 开启以后台进程启动:将
deamonize yes
修改为daemonize no
。
6. 启动 Redis 服务
cd ./src
./redis-server /etc/redis/redis.conf