- 更新yum源
yum install -y http://rpms.famillecollet.com/enterprise/remi-release-7.rpm
- 安装redis
yum --enablerepo=remi install redis
- 启动redis服务和开机自启动配置
systemctl start redis
systemctl enable redis.service
- 设置远程连接,设置完成后重启redis
打开/etc/redis.conf,增加如下
bind 0.0.0.0
protected-mode no
- 打开6379端口,并且重启防火墙
1.增加端口:sudo firewall-cmd --zone=public --add-port=6379/tcp --permanent
2.重启防火墙:sudo systemctl restart firewalld.service