I am checking Redis high availability solution via configuration of master and slave Redis Kubernetes pods and sentinel on top of it. For failover of external client connections, I installed haproxy pod. I encountered with some issue while started testing the configuration:
Error: Server closed the connection.
BTW: if Redis is configured with an empty password, the connection is passing OK.
I appreciate any idea and advice. My HA proxy cfg file has the following entries:
global
daemon
maxconn 500
defaults
mode http
timeout connect 5000ms
timeout client 50000ms
timeout server 50000ms
frontend rotatingproxies
bind *:3000
default_backend rotateproxy
option http_proxy
option http-use-proxy-header
backend rotateproxy
option http_proxy
server proxyserver user:pass@domain.com:9999
server proxyserver user:pass@domain.com:9999
balance roundrobin
Increase timeout client and timeout server to values at least two times more than tcp-keepalive in redis.conf file (default 300 s,my recommendation 60s)
For e.g: if tcp-keepalive 60
than
timeout server 120s
timeout client 120s