io.lettuce.core.RedisCommandTimeoutException: Command timed out after 5 second(s)

lettuce连接redis报错io.lettuce.core.RedisCommandTimeoutException: Command timed out after 5 second(s),我的spring.redis.timeout = 5000。

解决办法:

  1. 登陆redis容器
  2. 输入redis-cli进入redis控制台
  3. 设置 CONFIG SET timeout "60"
  4. 设置 CONFIG SET tcp-keepalive "300"

参考

Redis 配置

版权

评论