安装

1
2
3
4
5
yum -y install gcc-c++
wget http://download.redis.io/releases/redis-5.0.9.tar.gz
tar xzf redis-5.0.9.tar.gz
cd redis-5.0.9
make

配置

1
2
3
4
5
6
7
8
9
#修改配置文件
vi ./redis.conf

#daemonize设置为yes
daemonize yes
#密码
requirepass 123
#注释
#bind 127.0.0.1
  1. 启动 src/redis-server ./redis.conf

命令

1
2
#登录
redis-cli -h 127.0.0.1 -p 6379 -a password -c