Skip to content

Instantly share code, notes, and snippets.

@nathwill
Created April 18, 2016 23:42

Revisions

  1. nathwill created this gist Apr 18, 2016.
    24 changes: 24 additions & 0 deletions ha-redis-keepalived.conf
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,24 @@
    vrrp_script chk_redis_master {
    script "redis-cli info replication | grep -q 'role:master'"
    interval 2
    weight 2
    rise 2
    fall 2
    }

    vrrp_instance redis_vip {
    interface eth0
    state BACKUP
    virtual_router_id 49
    priority 100
    authentication {
    auth_type PASS
    auth_pass changeme
    }
    virtual_ipaddress {
    10.2.3.49/24 brd 10.2.3.255 dev eth0
    }
    track_script {
    chk_redis_master
    }
    }