[解決]spring-boot連接redis報連接超時問題Unable to connect to Redis; nested exception is io.lettuce.core.RedisCommandTimeoutException: Command timed out


在學習純潔的微笑的spring-boot整合redis的時候發現總是報redis連接超時

原文連接:https://www.cnblogs.com/ityouknow/p/5748830.html

最后發現是在application.properites的redis配置中的spring.redis.timeout中連接超時時間(毫秒)中時間設置不能為0

spring-boot整合redis過程中的坑

當使用spring-boot 1.4一下的版本的時候redis可以使用:spring-boot-starter-redis

使用1.4以上的版本的時候需要使用spring-boot-starter-data-redis

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM