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