Skip to content

Instantly share code, notes, and snippets.

@viktortnk
Created August 30, 2020 16:32
Show Gist options
  • Save viktortnk/0165397a745c8f7b3fb6a2c3118d930c to your computer and use it in GitHub Desktop.
Save viktortnk/0165397a745c8f7b3fb6a2c3118d930c to your computer and use it in GitHub Desktop.
Redis topologies
# Specifies TCP timeout on connect for use by the frontend ft_redis
# Set the max time to wait for a connection attempt to a server to succeed
# The server and client side expected to acknowledge or send data.
defaults REDIS
mode tcp
timeout connect 3s
timeout server 6s
timeout client 6s
# Specifies listening socket for accepting client connections using the default
# REDIS TCP timeout and backend bk_redis TCP health check.
frontend ft_redis
bind *:6378 name redis
default_backend bk_redis
# Specifies the backend Redis proxy server TCP health settings
# Ensure it only forward incoming connections to reach a master.
backend bk_redis
option tcp-check
tcp-check connect
tcp-check send PING\r\n
tcp-check expect string +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 redis_6379 localhost:6379 check inter 1s
server redis_6380 localhost:6380 check inter 1s
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment