【发布时间】:2018-11-04 12:50:54
【问题描述】:
我正在尝试使用 JedisSentinelPool 连接到 redis sentinel
private static final JedisSentinelPool pool = new JedisSentinelPool("mymaster", getSentinels());
private static Set<String> getSentinels(){
Set<String> mysentinels = new HashSet<>();
mysentinels.add(new HostAndPort("localhost", 26379).toString());
return mysentinels;
}
这给了我以下错误:
原因:redis.clients.jedis.exceptions.JedisConnectionException: All sentinels down, 无法确定 mymaster master 在哪里运行...
但是,我可以看到我的哨兵正在运行。所以参考这篇文章: https://github.com/luin/ioredis/issues/64 我在我的 redis 主服务器上尝试了以下命令
./redis-cli -h redis-1 -p 26379
我收到以下错误:
无法在 redis-1:26379 连接到 Redis:提供了节点名和服务名,或者未知
这里有什么问题?
【问题讨论】:
-
我面临着类似的问题。提供了哨兵路径,我从
redis-cli检查了我的哨兵正在运行。我仍然遇到同样的异常。
标签: redis redis-sentinel