- 环境是 springboot2.0,连接池是 springboot 带的 lettuce
- 配置使用的是默认配置
- 现象就是 一段时间不是用 redis, 再去使用的时候就会报 command timeout exception
下面是报错信息
Redis command timed out; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out
at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:70)
at org.springframework.data.redis.connection.lettuce.LettuceExceptionConverter.convert(LettuceExceptionConverter.java:41)
at org.springframework.data.redis.PassThroughExceptionTranslationStrategy.translate(PassThroughExceptionTranslationStrategy.java:44)
at org.springframework.data.redis.FallbackExceptionTranslationStrategy.translate(FallbackExceptionTranslationStrategy.java:42)
at org.springframework.data.redis.connection.lettuce.LettuceConnection.convertLettuceAccessException(LettuceConnection.java:257)
at org.springframework.data.redis.connection.lettuce.LettuceKeyCommands.convertLettuceAccessException(LettuceKeyCommands.java:650)
at org.springframework.data.redis.connection.lettuce.LettuceKeyCommands.keys(LettuceKeyCommands.java:148)
at org.springframework.data.redis.connection.DefaultedRedisConnection.keys(DefaultedRedisConnection.java:75)
at org.springframework.data.redis.core.RedisTemplate.lambda$keys$10(RedisTemplate.java:840)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:224)
at org.springframework.data.redis.core.RedisTemplate.execute(RedisTemplate.java:184)
at org.springframework.data.redis.core.RedisTemplate.keys(RedisTemplate.java:840)
早网上找了找没找到什么有用的解决方案,特来请教