cd /opt
wget http://download.redis.io/releases/redis-5.0.8.tar.gz
tar -zxf redis-5.0.8.tar.gz -C /usr/local/bin/
cd /usr/local/bin/
mv redis-5.0.8 redis
cd /usr/local/bin/redis
make MALLOC=libc/jemalloc
cd src
make install
cd /usr/local/bin/
cp -a redis/redis.conf /etc/redis-master.conf
# 编辑配置文件
vi /etc/redis-master.conf
daemonize yes
pidfile /var/run/redis.pid
port 6379
timeout 300
loglevel debug
logfile stdout
databases 16
save 900 1
save 300 10
save 60 10000
rdbcompression yes
dbfilename dump.rdb
dir /usr/local/bin/redis
appendonly no
appendfsync always
# 启动服务
nohup /usr/local/bin/redis-server /etc/redis-master.conf >/dev/null 2>&1 &
# 验证
netstat -lntup | grep 6379
lsof -i :6379