org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis; nested exception is org.springframework.data.redis.connection.PoolException: Could not get a resource from the pool; nested exception is io.lettuce.core.RedisConnectionException: Unable to connect to 10.129.28.251/<unresolved>:6379
本地客户端可以,那么就是springboot的原因:
spring:
redis:
# url: redis://:password@xx.xx.xx.xx:6379
host: xx.xx.xx.xx
port: 6379
password: xxxxxx
方法一:把host port password 全部注释掉,用url看是否可以
spring:
redis:
url: redis://:password@xx.xx.xx.xx:6379
# host: xx.xx.xx.xxx
# port: 6379
# password: xxxxx
方法二:将password加上单引号
spring:
redis:
# url: redis://:password@xx.xx.xx.xx:6379
host: xx.xx.xx.xx
port: 6379
password: 'xxxxxx'