centos7 安装redis-5.0.2

下载redis

wget http://download.redis.io/releases/redis-5.0.2.tar.gz

解压

tar -zxvf redis-5.0.2.tar.gz

编译

cd /data/redis-5.0.2
make PREFIX=/usr/local/redis/

复制

cd src/
cp redis-benchmark redis-check-aof redis-check-rdb redis-cli redis-sentinel redis-server redis-trib.rb /usr/local/redis/bin/
cd ..
cp redis.conf /usr/local/redis/conf/

使用supervisor托管,配置conf

vi /data/supervisord.d/redis.conf
[program:redis]#program不能重复
directory = /usr/local/redis/bin #跳转到哪个目录
command=/usr/local/redis/bin/redis-server /usr/local/redis/conf/redis.conf #执行的命令
autostart=true
autorestart=true
user=root
numprocs=1
redirect_stderr=true
stdout_logfile=/data/logs/redis.log

更新supervisor配置

supervisorctl update

查看进程

[root@daxian ~]# ps aux | grep redis
root     28741  0.0  0.1 163052 14516 ?        Sl   10:16   0:11 /usr/local/redis/bin/redis-server *:6379
root     29039  0.0  0.0 112660   968 pts/0    S+   14:41   0:00 grep --color=auto redis

 

你可能感兴趣的:(linux)