haproxy_keydb.cfg.j2 709 B

123456789101112131415161718192021222324252627
  1. global
  2. user haproxy
  3. group haproxy
  4. defaults KEYDB
  5. mode tcp
  6. timeout connect 3s
  7. timeout server 6s
  8. timeout client 6s
  9. frontend ft_keydb
  10. bind {{ keepalived_vip }}:{{ redis_vip_port }} name redis
  11. default_backend bk_keydb
  12. backend bk_keydb
  13. option tcp-check
  14. #tcp-check send *1\r\n$4\r\nping\r\n
  15. #tcp-check expect string +PONG
  16. tcp-check send PING\r\n
  17. tcp-check expect string +PONG
  18. tcp-check send info\ replication\r\n
  19. tcp-check expect string role: active-replica
  20. tcp-check send QUIT\r\n
  21. tcp-check expect string +OK
  22. {% for item in haproxy_backend_servers %}
  23. server {{ item }} {{ hostvars[item]['ansible_host'] }}:{{ redis_port }} check inter 100ms
  24. {% endfor %}