This repository has been archived by the owner. It is now read-only.
Basic failover for local Redis instances with Keepalived
Switch branches/tags
Nothing to show
Clone or download
Latest commit 82d4bf7 Apr 8, 2015


I don't use this anymore, and don't plan on maintaining it. Please use at your own risk.

Usage Options:

  • -m promote the redis-server to MASTER
  • -s promote the redis-server to SLAVE
  • -k start the redis-server and promote it to MASTER


  • Redis 2.2.12
  • Keepalived 1.1.20

Redis Setup:

useradd -m -U redis
chmod 750 /home/redis
cd /home/redis
sudo -u redis git clone redis.git
cd redis.git
git checkout 2.2.12
sudo make


  • MASTER/SLAVE config: /home/redis/redis-mdb.conf (runs on port 6379)

How it works:

  • Keepalived runs on the Redis MASTER and SLAVE servers
  • The Redis MASTER binds the IP
  • The Redis SLAVE connects to a Master server which has the IP
  • Keepalived handles checking and runs a script if a server is online or offline
  • This script will handle starting Redis promoting it to MASTER or SLAVE


This has NOT been tested in a production environment, use at your own risk


Copyright (c) 2011 Alex Williams. See LICENSE for details.