A quick example for setting up Redis cluster with HAProxy TCP load balancing.
Check everything is oke.
terraform plan
Apply changes.
terraform apply
- 3 redis master nodes and 3 replicas
- HAProxy for redis load balancing
- custom docker container to run the redis-trib tool to set up the cluster. (this is a modifed version of it to allow unattended install)
- Ticket (redis/redis#3143) PR (redis/redis#3602)
All nodes can be scaled up or down.
Note: please ensure change the volumes locations before running Also bear in mind that the way the config files are rendered the
\r\n
dont get escaped properly so if haproxy is not work just make sure it matches the tpl file. I am working on a solution for that.
To create the redis-clusterer
container run.
docker build. -t redis-clusterer