spring-boot-version: 3.2.4
redis config:
spring:
data:
redis:
host: [docker-server-name]
port: 6379
no password, so error message is: io.lettuce.core.RedisConnectionException: Unable to connect to [docker-server-name]/
but use local env file ,just change host: localhost is ok
eg:
spring:
data:
redis:
host: localhost
port: 6379
important: spring-boot version: 3.0.4
spring:
data:
redis:
host: [docker-server-name]
port: 6379
this config is ok
Comment From: wilkinsona
Thanks for the report but I don't think this is a Spring Boot problem. It's clear from the error message that the correct configuration has been passed into Lettuce as it knows to try to connect to [docker-server-name] on port 6379. Exactly how it uses that configuration to connect to Redis is out of Spring Boot's control. I would guess that there's a networking or Docker DNS problem such that [docker-server-name] isn't being resolved to the correct IP.