windos单机情况下redis使用哨兵模式 前提是配置好redis主从复制
1.创建哨兵配置文件 sentinel.conf 在redis根目录或自己配置文件中
# 当前Sentinel服务运行的端口
port 26379
#而将这个主实例判断为失效至少需要2个Sentinel进程的同意,只要同意Sentinel的数量不达标,自动failover就不会执行
# 如果提供外网访问,实例的IP地址为服务器地址10.0.128.144。
# sentinel monitor 被监控的名称 host port 1
sentinel monitor myredis 127.0.0.1 6379 1
#监听机器 win下使用
bind 127.0.0.1
2.启动哨兵 在cmd窗口redis根目录运行 myconf/sentinel.conf(自己的哨兵配置目录位置)
redis-server.exe myconf/sentinel.conf --sentinel
感谢B站狂神说!!!