You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We can loadbalance a Redis Master-Slave cluster with HAPROXY.
Conf:
==> Reads will be equally distributed to both Master & Slave nodes.
==> Writes will be directed to Master with Slave node as failover.
HAP Conf:
backend seo_redis_read
balance roundrobin
mode tcp
server MASTER check inter 6000 rise 3 fall 3 weight 100
server SLAVE check inter 6000 rise 3 fall 3 weight 100
backend seo_redis_write
mode tcp
server MASTER check inter 6000 rise 3 fall 3 weight 100
server SLAVE check inter 6000 rise 3 fall 3 weight 100 backup
NOTE: Change the slave conf to accept writes. This can be done by commenting out readonly-slave parameter in slave conf file. When current master is down, slave needs to be made master by running the command slaveof no one.