1、查询是否已经安装了redis
rpm -qa|grep redis #如果有安装了 ,执行rpm -e redis卸载
2、下载redis rpm包并安装
get https://rpms.remirepo.net/enterprise/7/remi/x86_64/redis-6.2.6-1.el7.remi.x86_64.rpm #也可去http://pkgs.org/download/redis找合适的版本 rpm -ivh redis-6.2.6-1.el7.remi.x86_64.rpm #授权日志目录: chown redis:redis /var/log/redis/redis.log #根据需要编辑配置文件: vim /etc/redis.conf daemonize yes bind 127.0.0.1
3、启动、重启、停止redis
systemctl start redis systemctl status redis systemctl stop redis
4、设置开机自启动
systemctl enable redis systemctl list-unit-files|grep redis
转载请注明:零五宝典 » Linux CentOS7使用rpm方式安装redis