New Puppet module for Redis and Sentinel

72 views
Skip to first unread message

Chip Burke

unread,
Apr 9, 2015, 5:27:36 PM4/9/15
to redi...@googlegroups.com
This is a bit of a shameless plug, but hopefully this is of value to the community. We were a very early adopter of Sentinel for HA Redis. I hand built out a Sentinel and Redis based on 2.6.x a few years back that we still use for production. We want to move to multiple instances and get on a modern build AND automate the whole thing. Thus one of my guys did (what I think) is a brilliant job putting together a Puppet module to handle large implementations of Redis and Sentinel. 

Our internal setup has 3 Sentinels. These three Sentinels then monitor all of our Redis servers. Sentinel then redirects the applications to directly speak to their respective active Redis servers. Additionally, the Puppet module handles persistence. The idea being, we always deploy Redis on at least two nodes. One node is active, the other nodes are slaves. We found we would get applications failing as AOF writes or BGSAVEs would happen during heavy loads causing waits. Therefore, we set slaves to persist to disk while the master did not. In the case of a failover, the Puppet module automatically disables persistence on the master and re-enables persistence on the old master once it comes back up and becomes a slave. For those of you who say "but you'll lose persistence between Puppet runs!".... deploy 3 Redis servers so you have redundancy in your persistence on the two slaves.

In any event:


We hope this is of use to folks and please contribute if you see room for improvement. 

Ostap36

unread,
Apr 10, 2015, 5:14:20 PM4/10/15
to redi...@googlegroups.com
Hello Chip, thank you for the post. Question how does puppet know in a case of fail-over to update/re-configure persistence config options? I.e. what's the trigger point, sentinel's notification script or does it monitor the redis.conf or ...?
Message has been deleted

Chip Burke

unread,
Apr 10, 2015, 5:37:24 PM4/10/15
to redi...@googlegroups.com
I am not the author, but rather one of the guys on my team wrote this. I have forwarded this thread to Dan to have him answer your question. You can also dig through the code on Git here if you are feeling froggy.


Thanks for your interest!

Ostap36

unread,
Apr 10, 2015, 5:42:02 PM4/10/15
to redi...@googlegroups.com
Yes just looked at the blog post and the source on github and found my answer - cron job parses the output of redis-cli to get the current role and then calls config rewrites based on that.

Thank you
Reply all
Reply to author
Forward
0 new messages