Redis sentinel + HAProxy failover

7,466

I guess this is what you are looking for, this setup can be easily changed to abstract slave-reads, too.

http://blog.exceliance.fr/2014/01/02/haproxy-advanced-redis-health-check/

Cheers, Jan

Share:
7,466

Related videos on Youtube

JonoCoetzee
Author by

JonoCoetzee

Software Developer (mobile and web) with previous experience in security (pentester for an InfoSec company).

Updated on September 18, 2022

Comments

  • JonoCoetzee
    JonoCoetzee over 1 year

    I am looking to implement a HA redis implementation using Master-Slave redis servers. The web servers will connect to these through an HAProxy instance installed on each box.

    The situation is easy with only two servers, if one goes down the other has to be made the new master. But what about when there are more than one slaves and either one of the remaining slaves can be promoted to master? I know redis sentinel has a notification mechanism in the event of a failover but how do I use it to interact with the HAproxy's on each of the web servers and tell them which server is the new master?

    First time working with redis and replication/failover in general.

  • anthonysomerset
    anthonysomerset over 10 years
    works perfect for me :) it would be recommended to extract key parts from that post in case the link goes missing in future and so that your answer is better