解决Spring Boot2整合Redis后报错:Redis exception; nested exception is io.lettuce.core.RedisException: java.io.IOException: 远程主机强迫关闭了一个现有的连接

1、修改sshd_config

vim /etc/ssh/sshd_config

ClientAliveInterval 600
ClientAliveCountMax 10
#重启
service sshd restart

2、修改redis配置文件

tcp-keepalive 10
timeout 0

3、修改spring boot配置文件

redis: #Redis配置
  host: 121.199.88.88
  port: 6379
  password: xxxxxx
  timeout: 50000

 

posted @ 2022-10-03 22:59  滔天蟹  阅读(2713)  评论(0)    收藏  举报