https://baijiahao.baidu.com/s?id=1621918338213717988
将Centos的yum源更换为国内的阿里云源
备份你的原镜像文件,保证出错后可以恢复:
mv /etc/yum.repos.d/CentOS-Base.repo /etc/yum.repos.d/CentOS-Base.repo.backup
下载新的CentOS-Base.repo 到/etc/yum.repos.d/
wget -O /etc/yum.repos.d/CentOS-Base.repo http://mirrors.aliyun.com/repo/Centos-7.repo
安装redis
yum install redis
防止出现# [MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist](强制关闭Redis快照导致不能持久化)的错误
vi /etc/redis.conf
找到stop-writes-on-bgsave-error,修改为no
启动redis
systemctl start redis.service
设置redis开机启动
systemctl enable redis.service