Skip to content

Instantly share code, notes, and snippets.

@francolaiuppa
Created November 14, 2014 18:57
Show Gist options
  • Save francolaiuppa/9507d003c9694c451bee to your computer and use it in GitHub Desktop.
Save francolaiuppa/9507d003c9694c451bee to your computer and use it in GitHub Desktop.
Example HAProxy 1.5 configuration for load-balancing Redis nodes with Sentinel (including health checks!)
backend messages
mode tcp
option tcplog
option tcp-check
#tcp-check send AUTH\ foobar\r\n
#tcp-check expect +OK
tcp-check send PING\r\n
tcp-check expect +PONG
tcp-check send info\ replication\r\n
tcp-check expect string role:master
tcp-check send QUIT\r\n
tcp-check expect string +OK
server redis15 192.168.15.40:6379 maxconn 1024 check inter 1s
server redis17 192.168.15.41:6379 maxconn 1024 check inter 1s
server redis19 192.168.15.42:6379 maxconn 1024 check inter 1s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment