haproxy_keydb.new 1.5 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. global
  2. log /dev/log local0
  3. log /dev/log local1 notice
  4. chroot /var/lib/haproxy
  5. #stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners
  6. stats timeout 30s
  7. user haproxy
  8. group haproxy
  9. daemon
  10. # The lines below enable multithreading. This should correlate to number of threads available you want to use.
  11. nbproc 1
  12. #nbthread 4
  13. #cpu-map auto:1/1-4 0-3
  14. # Default SSL material locations
  15. #ca-base /etc/ssl/certs
  16. #crt-base /etc/ssl/private
  17. # Default ciphers to use on SSL-enabled listening sockets.
  18. #ssl-default-bind-ciphers ECDH+AESGCM:DH+AESGCM:ECDH+AES256:DH+AES256:ECDH+AES128:DH+AES:RSA+AESGCM:RSA+AES:!aNULL:!MD5:!DSS
  19. #ssl-default-bind-options no-sslv3
  20. maxconn 40000
  21. defaults
  22. log global
  23. mode http
  24. option httplog
  25. option dontlognull
  26. timeout connect 5000
  27. timeout client 50000
  28. timeout server 50000
  29. listen mykeydb
  30. bind *:{{ redis_vip_port }}
  31. maxconn 40000
  32. mode tcp
  33. balance first
  34. option tcplog
  35. option tcp-check
  36. #uncomment these lines if you have basic auth
  37. #tcp-check send AUTH\ yourpassword\r\n
  38. #tcp-check expect string +OK
  39. tcp-check send PING\r\n
  40. tcp-check expect string +PONG
  41. tcp-check send info\ replication\r\n
  42. tcp-check expect string role: active-replica
  43. tcp-check send QUIT\r\n
  44. tcp-check expect string +OK
  45. {% for item in haproxy_backend_servers %}
  46. server {{ item }} {{ hostvars[item]['ansible_host'] }}:{{ redis_port }} maxconn 20000 check inter 1s
  47. {% endfor %}