Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save nguyenthenguyen/597d898331d6a1addd1537134dbfa6ee to your computer and use it in GitHub Desktop.
Save nguyenthenguyen/597d898331d6a1addd1537134dbfa6ee 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