解决问题:Unable to connect to Redis
生活随笔
收集整理的這篇文章主要介紹了
解决问题:Unable to connect to Redis
小編覺得挺不錯的,現在分享給大家,幫大家做個參考.
錯因:無法連接到redis
最近在使用springboot整合redis時,出現的錯誤:
Unable to connect to Redis; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to localhost:6379
解決:需要到springboot配置文件中配置一些相關參數去連接Redis
spring:redis:host: 192.168.1.1 #服務器地址 你服務器或本機地址port: 6379 #連接端口database: 0 #數據庫索引,默認0password: 123456 #密碼jedis:pool:max-active: 8 #連接池最大連接數(使用負值表示沒有限制)max-wait: -1 #最大阻塞等待時間(使用負值表示沒有限制)max-idle: 8 #最大空閑連接數min-idle: 0 #最小空閑連接數timeout: 5000 #連接超時時間(毫秒)配置完這些參數即可使用
總結
以上是生活随笔為你收集整理的解决问题:Unable to connect to Redis的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: “鲲鹏”展翅 宝德“自强”
- 下一篇: 无语!35 岁华人程序员涉嫌诈骗 150