http://www.it610.com/article/5366496.htm

环境前提:
    redis sentinel配置,三台主机,且配置运行良好


配置文件中添加:
frontend ft_redis
 bind 0.0.0.0:6379 name redis
 default_backend bk_redis

backend bk_redis
 option tcp-check
 tcp-check connect
 tcp-check send PING\r\n
 tcp-check expect string +PONG
 tcp-check send info\ replication\r\n
 tcp-check expect string role:master
 tcp-check send QUIT\r\n
 tcp-check expect string +OK
 server R1 10.118.36.10:6379 check inter 1s
 server R2 10.118.36.74:6379 check inter 1s
 server R3 10.118.5.161:6379 check inter 1s
haproxy配置监控redis主备切换_第1张图片 
当结果如下所示,则表示成功,那么试着切换redis的masterslave吧

haproxy配置监控redis主备切换
文档更新时间: 2019-10-08 10:01   作者:月影鹏鹏