• notice
  • Congratulations on the launch of the Sought Tech site

SpringBoot error connecting to redis:exception is io.lettuce.core.RedisException: java.io.IOException: remote host forced an existing connection to close

1. Solutions

(1). Check whether the configuration of redis is correct

the spring
         host: localhost
         port: 6379
         password: 123456
         database: 0
         timeout: 60s
         ## Change the connection pool from jedis to lettuce after springboot2.0
             max-idle: 30
             max-active: 8
             max-wait: 10000
             min-idle: 10

(2). At the same time, configure the tcp-keepalive time in redis.conf to be 60s; the redis-3.2.1 version defaults to 300, and the above problem does not appear after setting 60



Technical otaku

Sought technology together

Related Topic


Leave a Reply