准备工作
mkdir -p /home/redis
cd /home/redis
redis.conf配置地址
mkdir -p ./conf
#logfile 地址
mkdir -p ./log-redis
#pidfile 地址
mkdir -p ./pid-redis
#dir 地址
mkdir -p ./rdb-aof-redis
#运行目录
mkdir -p ./redis-5.0.5
授权访问
chmod 777 -R /home/redis
–解压
tar -xzvf redis-5.0.5.tar.gz
安装
make PREFIX=/home/redis/redis-5.0.5 install
修改配置文件
vi redis.conf
#以下参数按如下调整,其它默认不变
bind ip 127.0.0.1
protected-mode no
port 6379
daemonize yes
pidfile /home/redis/pid-redis/redis.pid
logfile /home/redis/log-redis/redis.log
dbfilename redis_dump.rdb
dir /home/redis/rdb-aof-redis
maxmemory 15GB
appendonly yes
appendfilename "redis_appendonly.aof"
requirepass "*******"
启动
/home/redis/redis-5.0.5/bin/redis-server /home/redis/conf/redis.conf&
#登录验证
/home/redis/redis-5.0.5/bin/redis-cli -h ip -p 6379
#密码
auth 你的密码
#查看Key
scan 0