搭建Redis

1. 下载并解压

首先从Redis官网下载Redis并解压,楼主使用的版本是4.0.2。依次执行如下命令:

cd /usr/local/
wget https://github.com/antirez/redis/archive/unstable.tar.gz
tar -zxvf unstable.tar.gz

编译

make&make install

redis命令

redis-benchmark  
redis-check-rdb  
redis-sentinel   
redis-check-aof  
redis-cli        
redis-server

拷贝配置文件

cp redis.conf /etc/

修改配置文件

vim /etc/redis.conf //修改如下配置
daemonize yes
logfile "/var/log/redis.log" 
dir /data/redis_data/
appendonly yes

猜你喜欢

转载自blog.51cto.com/chenshengsheng/2113166