SpringBoot连接Linux服务器上的Redis报错:Unable to connect to Redis
解决方案:
1.关闭linux防火墙
1:查看防火状态
systemctl status firewalld
2:暂时关闭防火墙
systemctl stop firewalld
3:永久关闭防火墙
systemctl disable firewalld
4:重启防火墙
systemctl enable firewalld
2.找到redis.conf配置文件,注释一行配置
# bind 127.0.0.1
3.如果出现下面错误提示
修改redis.conf配置文件 protected-mode yes 改为 protected-mode no
-
以上步骤做完,如果你redis服务在后台运行,请杀死进程重启服务。
-
查看 redis 进程 ps -ef | grep redis 杀死进程 kill -9 进程号