Advertisement
Guest User

Untitled

a guest
Nov 10th, 2018
655
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.94 KB | None | 0 0
  1. #---------------------------------------------------------------------
  2. # Global settings
  3. #---------------------------------------------------------------------
  4. global
  5. description PostgreSQL Database HAProxy Stats page
  6. log 127.0.0.1 local0 info
  7. chroot /var/lib/haproxy
  8. pidfile /var/run/haproxy.pid
  9. maxconn 3000
  10. user haproxy
  11. group haproxy
  12. daemon
  13. # turn on stats unix socket
  14. stats socket /var/lib/haproxy/stats
  15.  
  16. #---------------------------------------------------------------------
  17. # common defaults that all the 'listen' and 'backend' sections will
  18. # use if not designated in their block
  19. #---------------------------------------------------------------------
  20. defaults
  21. log global
  22. retries 2
  23. timeout client 30m
  24. timeout connect 4s
  25. timeout server 30m
  26. timeout check 5s
  27.  
  28. #---------------------------------------------------------------------
  29. # stats page
  30. #---------------------------------------------------------------------
  31. listen statspage
  32. mode http
  33. bind *:7000
  34. stats enable
  35. stats uri /
  36. stats refresh 30s
  37. stats auth admin:admin
  38. stats show-desc
  39. stats show-legends
  40. #---------------------------------------------------------------------
  41. # postgresql databases
  42. #---------------------------------------------------------------------
  43. listen postgresql
  44. mode tcp
  45. bind 0.0.0.0:5000
  46. timeout client 20m
  47. timeout connect 1s
  48. timeout server 20m
  49. option tcplog
  50. balance leastconn
  51. option log-health-checks
  52. option tcpka
  53. option tcplog
  54. option httpchk GET /pgcheck/username/haproxy/port/5432 # checker’s settings
  55. http-check send-state
  56. server pg01 171.90.1.2:5432 weight 1 check addr 171.90.1.2 port 8080 inter 5000 rise 2 fall 3
  57. server pg02 172.90.1.3:5432 weight 1 check addr 172.90.1.3 port 8080 inter 5000 rise 2 fall 3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement