Advertisement
thanh_thu

haproxy

Aug 5th, 2019
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.32 KB | None | 0 0
  1. echo 'global
  2. log 127.0.0.1 local2
  3. chroot /var/lib/haproxy
  4. pidfile /var/run/haproxy.pid
  5. maxconn 4000
  6. user haproxy
  7. group haproxy
  8. daemon
  9. stats socket /var/lib/haproxy/stats
  10.  
  11. defaults
  12. mode http
  13. maxconn 8000
  14. log global
  15. option httplog
  16. option dontlognull
  17. option http-server-close
  18. retries 3
  19. timeout http-request 20s
  20. timeout queue 1m
  21. timeout connect 10s
  22. timeout client 1m
  23. timeout server 1m
  24. timeout http-keep-alive 10s
  25. timeout check 10s
  26.  
  27. listen stats
  28. bind *:8080 interface ens160
  29. mode http
  30. stats enable
  31. stats uri /stats
  32. stats realm HAProxy\ Statistics
  33. stats admin if TRUE
  34.  
  35. listen web-backend
  36. bind *:80
  37. balance roundrobin
  38. cookie SERVERID insert indirect nocache
  39. mode http
  40. option httpchk
  41. option httpclose
  42. option httplog
  43. option forwardfor
  44. server controller01 192.168.10.122:8081 check cookie controller01 inter 5s fastinter 2s rise 3 fall 3
  45. server controller02 192.168.10.123:8081 check cookie controller02 inter 5s fastinter 2s rise 3 fall 3' > /etc/haproxy/haproxy.cfg
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement