官网
You can either download the latest Redis tar ball from the redis.io web site, or you can alternatively use this special URL that always points to the latest stable Redis version, that is, download.redis.io/redis-stabl…
你可以从 Redis.io 网站下载最新的 Redis tar ball,或者你也可以选择使用这个特殊的 URL,它总是指向最新的稳定 Redis 版本,也就是 download.Redis.io/Redis-stabl…
In order to compile Redis follow these simple steps:
为了编译 Redis,请遵循以下简单步骤:
wget http://download.redis.io/redis-stable.tar.gz
tar xvzf redis-stable.tar.gz
cd redis-stable
make
安装Redis
下载
Historical downloads are still available on download.redis.io/releases/
wget http://download.redis.io/releases/redis-4.0.11.tar.gz
解压
tar -zxvf redis-4.0.11.tar.gz
进入redis目录
cd redis-4.0.11
安装
make PREFIX=/usr/local/redis install
配置redis.conf
#在redis-4.0.11执行,复制redis配置文件到安装目录下
[root@localhost redis-4.0.11]# cp *.conf /usr/local/redis/bin/
#进入到安装目录
[root@localhost redis-4.0.11]# cd /usr/local/redis/bin/
#编辑
[root@localhost bin]# vim redis.conf
#主要修改以下配置如下
#=========
bind 0.0.0.0
#保护模式开启
protected-mode yes
#开启后台启动
daemonize yes
#日志
logfile "./redis.log"
#开启aof
appendonly yes
#设置自定义密码123456
requirepass 123456
#=========
#保存退出
启动
#启动
[root@localhost bin]# ./redis-server redis.conf
#查看redis服务
[root@localhost bin]# netstat -ntlp |grep redis
tcp 0 0 0.0.0.0:6379 0.0.0.0:* LISTEN 30035/./redis-serve
测试
[root@localhost bin]# redis-cli
127.0.0.1:6379> ping
(error) NOAUTH Authentication required.
127.0.0.1:6379> auth 123456
OK
127.0.0.1:6379> ping
PONG