• 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
     redis:
         host: localhost
         port: 6379
         password: 123456
         database: 0
         timeout: 60s
         ## Change the connection pool from jedis to lettuce after springboot2.0
         lettuce:
           pool:
             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

2156747-20220817085853849-1486006139.png


Tags

Technical otaku

Sought technology together

Related Topic

0 Comments

Leave a Reply

+