https://baijiahao.baidu.com/s?id=1621918338213717988
將Centos的yum源更換為國(guó)內(nèi)的阿里云源
備份你的原鏡像文件吗讶,保證出錯(cuò)后可以恢復(fù):
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
防止出現(xiàn)# [MISCONF Redis is configured to save RDB snapshots, but is currently not able to persist](強(qiáng)制關(guān)閉Redis快照導(dǎo)致不能持久化)的錯(cuò)誤
vi /etc/redis.conf
找到stop-writes-on-bgsave-error兰怠,修改為no
啟動(dòng)redis
systemctl start redis.service
設(shè)置redis開(kāi)機(jī)啟動(dòng)
systemctl enable redis.service