Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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.

share|improve this question

1 Answer 1

up vote 2 down vote accepted

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|improve this answer
    
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 –  anthonysomerset Jan 15 at 21:02
    
Thanks for this! –  JonoCoetzee Jan 22 at 9:34

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.