使用阿里云远程Redis时,IDEA报错Caused by:io.lettuce.core.RedisConnectionException:Unable to connect to X.X.X.X:6379或者Caused by:io.lettuce.channel.ConnectTimeoutException:connect timed out:/ X.X.X.X:6379
1.设置redis.conf
-
取消保护模式
protected-mode no
-
注释bind 127.0.0.1
#bind 127.0.0.1
2.关闭防火墙(或者设置开放6379)
systemctl status firewalld.service 查看防火墙状态(running 或者 dead)
systemctl stop firewalld 关闭防火墙
3.最重要的,需在阿里云安全组中开放6379端口
一定要开放!!
4*.设置端口号永久运行 (这步可以忽略)
=============================================================================================
网上的大多数教程都只说了前两步,如果是使用阿里云远程的redis服务一定要进入阿里云官网在安全组中打开端口号!!!