【发布时间】:2017-12-14 17:06:42
【问题描述】:
我在将 Spring Redis 与客户端连接时遇到问题。 所以我有一个带有主机名的代理,并且有 3 个 redis 节点,但只有一个可用。 我正在使用 LettuceConnectionFactory 创建连接。 当应用程序尝试连接到客户端时出现异常:
Caused by: java.lang.RuntimeException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis on unavailableIP:13376; nested exception is com.lambdaworks.redis.RedisConnectionException: Unable to connect to /unavailableIP:13376
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'enableRedisKeyspaceNotificationsInitializer' defined in org.springframework.session.data.redis.config.annotation.web.http.RedisHttpSessionConfiguration: Invocation of init method failed; nested exception is org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis on unavailableIP:13376; nested exception is com.lambdaworks.redis.RedisConnectionException: Unable to connect to /unavailableIP:13376
Caused by: org.springframework.data.redis.RedisConnectionFailureException: Unable to connect to Redis on unavailableIP:13376; nested exception is com.lambdaworks.redis.RedisConnectionException: Unable to connect to /unavailableIP:13376
Caused by: com.lambdaworks.redis.RedisConnectionException: Unable to connect to /unavailableIP:13376
Caused by: java.net.ConnectException: Connection refused: no further information: /unavailableIP:13376"}}
相反..如果我尝试从 Redis 桌面管理器连接,它可以工作..
有没有办法应用“重试”来获取可用的ip?
【问题讨论】:
标签: java spring proxy redis connection