From 010b9d4fb52f210b2724801b3a3ee1b516d66377 Mon Sep 17 00:00:00 2001 From: Samuel Clay Date: Wed, 1 Jun 2022 11:08:20 -0400 Subject: [PATCH] Multiple redis servers. --- ansible/inventories/digital_ocean.yml | 1 + docker/haproxy/haproxy.consul.cfg.j2 | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/ansible/inventories/digital_ocean.yml b/ansible/inventories/digital_ocean.yml index 4ca94a3fe..da18da2f4 100644 --- a/ansible/inventories/digital_ocean.yml +++ b/ansible/inventories/digital_ocean.yml @@ -29,6 +29,7 @@ groups: search: inventory_hostname.startswith('db-elasticsearch') elasticsearch: inventory_hostname.startswith('db-elasticsearch') redis: inventory_hostname.startswith('db-redis') + redis_story: inventory_hostname.startswith('db-redis-story') postgres: inventory_hostname.startswith('db-postgres') mongo: inventory_hostname.startswith('db-mongo') and not inventory_hostname.startswith('db-mongo-analytics') mongo_analytics: inventory_hostname.startswith('db-mongo-analytics') diff --git a/docker/haproxy/haproxy.consul.cfg.j2 b/docker/haproxy/haproxy.consul.cfg.j2 index ed2088a4c..c341a31b6 100644 --- a/docker/haproxy/haproxy.consul.cfg.j2 +++ b/docker/haproxy/haproxy.consul.cfg.j2 @@ -208,7 +208,10 @@ backend db_redis_user backend db_redis_story option httpchk GET /db_check/redis_story - server db-redis-story db-redis-story.node.nyc1.consul:5579 check inter 2000ms resolvers consul resolve-opts allow-dup-ip init-addr none + default-server check inter 2000ms resolvers consul resolve-prefer ipv4 resolve-opts allow-dup-ip init-addr none + {% for host in groups.redis_story %} + server {{host}} {{host}}.node.nyc1.consul:5579 + {% endfor %} backend db_redis_sessions option httpchk GET /db_check/redis_sessions