完整报错:
unable to connect to redis; nested exception is io.lettuce.core.redisconnectionexception: unable to connect to localhost/<unresolved>:6379] with root cause
报错原因:
我切换了springboot的版本,从3.0.x切换到了2.7.x,redis的配置变了
3+版本:
data:
redis:
host: 192.168.202.128
port: 6379
password: 123321
lettuce:
pool:
max-active: 10
max-idle: 10
min-idle: 1
time-between-eviction-runs: 10s
database: 1
而2.7版本需要去掉data配置:
redis:
host: 192.168.202.128
port: 6379
password: 123321
lettuce:
pool:
max-active: 10
max-idle: 10
min-idle: 1
time-between-eviction-runs: 10s
database: 1