All sentinels down, cannot determine where is mymaster master is running…

该错是创建redis连接池时调用一个方法导致的,如下:

public static String convertHost(String host) {
        return !host.equals("127.0.0.1") && !host.startsWith("localhost") && !host.equals("0.0.0.0") && !host.startsWith("169.254") && !host.startsWith("::1") && !host.startsWith("0:0:0:0:0:0:0:1") ? host : LOCALHOST_STR;
    }

原因:

  1. reids的配置文件redis.windows.conf把bind参数配置成了bind 127.0.0.1
  2. 还有sentinel 的配置文件sentinel.conf 中配置成了 sentinel monitor mymaster 127.0.0.1 6380 1

解决:

  1. 去掉bind。或者把ip设置成电脑的ip
  2. sentinel 的配置文件sentinel.conf 对应sentinel monitor mymaster ip 6380 1配置成1中的ip

详细可以参考:参考文章redis哨兵报错原因

Logo

北京人形旗下天工造物具身智能开源社区,聚焦具身天工与慧思开物两大平台

更多推荐