Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

@hiteshjoshi
Created March 4, 2019 13:59
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 hiteshjoshi/822723acf7b003d597c4538908a8a43a to your computer and use it in GitHub Desktop.
Save hiteshjoshi/822723acf7b003d597c4538908a8a43a to your computer and use it in GitHub Desktop.
defaults
mode tcp
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend http
bind :8080
default_backend stats
backend stats
mode http
stats enable
stats enable
stats uri /
stats refresh 1s
stats show-legends
stats admin if TRUE
frontend redis-alpha
bind *:6379
default_backend redis-alpha
backend redis-alpha
mode tcp
balance first
option tcp-check
tcp-check send auth\ YOUR_AUTH_FOR_REDIS\r\n
tcp-check send info\ replication\r\n
tcp-check expect string role:master
server redis-alpha:10.0.0.13:6379 10.0.0.13:6379 maxconn 1024 check inter 1s
server redis-alpha:10.0.0.4:6379 10.0.0.4:6379 maxconn 1024 check inter 1s
backend redis-online
mode tcp
balance first
option tcp-check
tcp-check send auth\ YOUR_AUTH_FOR_REDIS\r\n
tcp-check send PING\r\n
tcp-check expect string +PONG
server redis-alpha:10.0.0.13:6379 10.0.0.13:6379 maxconn 1024 check inter 1s
server redis-alpha:10.0.0.4:6379 10.0.0.4:6379 maxconn 1024 check inter 1s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment