windows搭建redis哨兵报错 :启动项目时All sentinels down, cannot determine where is mymaster master is running。
·
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;
}
原因:
- reids的配置文件
redis.windows.conf把bind参数配置成了bind 127.0.0.1 - 还有sentinel 的配置文件
sentinel.conf中配置成了sentinel monitor mymaster 127.0.0.1 6380 1
解决:
- 去掉bind。或者把ip设置成电脑的ip
- sentinel 的配置文件
sentinel.conf对应sentinel monitor mymaster ip 6380 1配置成1中的ip
详细可以参考:参考文章redis哨兵报错原因
更多推荐
所有评论(0)