https://www.cnblogs.com/hunanzp/p/12304622.html
官网下载地址:https://redis.io/download
cd /usr/local/src
wget http://download.redis.io/releases/redis-5.0.7.tar.gz
解压
cd /usr/local/src
tar -zxvf redis-5.0.7.tar.gz
编译
cd /usr/local/src/redis-5.0.7
make
安装
cd /usr/local/src/redis-5.0.7
make PREFIX=/usr/local/redis install
mkdir /usr/local/redis/data
修改配置文件
mv /usr/local/src/redis-5.0.7/redis.conf /usr/local/redis/bin/redis.conf
vim /usr/local/redis/bin/redis.conf
# 修改端口号,默认6379
port 6379
# 启动方式,改为后台启动
daemonize yes
# 允许访问的主机地址
bind * (bind 0.0.0.0)
# 外部网是否可以连接,需要外部网络,改为no
protected-mode no
# 数据库存储位置
dir /usr/local/redis/data
启动命令
cd /usr/local/redis/bin/
./redis-server ./redis.conf
连接命令
cd /usr/local/redis/bin/
./redis-cli