Advertisement
Guest User

Untitled

a guest
Aug 6th, 2018
156
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.77 KB | None | 0 0
  1. #---------------------------------------------------------------------
  2. # Example configuration for a possible web application. See the
  3. # full configuration options online.
  4. #
  5. # http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
  6. #
  7. #---------------------------------------------------------------------
  8.  
  9. #---------------------------------------------------------------------
  10. # Global settings
  11. #---------------------------------------------------------------------
  12. global
  13. # to have these messages end up in /var/log/haproxy.log you will
  14. # need to:
  15. #
  16. # 1) configure syslog to accept network log events. This is done
  17. # by adding the '-r' option to the SYSLOGD_OPTIONS in
  18. # /etc/sysconfig/syslog
  19. #
  20. # 2) configure local2 events to go to the /var/log/haproxy.log
  21. # file. A line like the following can be added to
  22. # /etc/sysconfig/syslog
  23. #
  24. # local2.* /var/log/haproxy.log
  25. #
  26. log 127.0.0.1 local2
  27.  
  28. chroot /var/lib/haproxy
  29. pidfile /var/run/haproxy.pid
  30. maxconn 4000
  31. user haproxy
  32. group haproxy
  33. daemon
  34.  
  35. # turn on stats unix socket
  36. stats socket /var/lib/haproxy/stats
  37.  
  38. #---------------------------------------------------------------------
  39. # common defaults that all the 'listen' and 'backend' sections will
  40. # use if not designated in their block
  41. #---------------------------------------------------------------------
  42. defaults
  43. mode http
  44. log global
  45. option httplog
  46. option dontlognull
  47. option http-server-close
  48. option forwardfor except 127.0.0.0/8
  49. option redispatch
  50. retries 3
  51. timeout http-request 10s
  52. timeout queue 1m
  53. timeout connect 10s
  54. timeout client 1m
  55. timeout server 1m
  56. timeout http-keep-alive 10s
  57. timeout check 10s
  58. maxconn 3000
  59.  
  60. #---------------------------------------------------------------------
  61. # main frontend which proxys to the backends
  62. #---------------------------------------------------------------------
  63. frontend main *:80
  64. #acl url_static path_beg -i /static /images /javascript /stylesheets
  65. #acl url_static path_end -i .jpg .gif .png .css .js
  66.  
  67. #use_backend static if url_static
  68. default_backend jira
  69.  
  70. #---------------------------------------------------------------------
  71. # static backend for serving up images, stylesheets and such
  72. #---------------------------------------------------------------------
  73. #backend static
  74. # balance roundrobin
  75. # server static 127.0.0.1:4331 check
  76.  
  77. listen stats
  78. bind *:4331
  79. no option nolinger
  80. maxconn 100
  81. stats enable
  82. stats uri /stats
  83. stats realm HAProxy\ Statisti
  84. stats refresh 5s
  85.  
  86. #---------------------------------------------------------------------
  87. # round robin balancing between the various backends
  88. #---------------------------------------------------------------------
  89. backend jira
  90. balance roundrobin
  91. option forwardfor
  92. server jira_node_1 127.0.0.1:8080 check fall 3 rise 2 inter 3s
  93. server jira_node_2 10.200.19.51:8080 check fall 3 rise 2 inter 3s
  94. #server app3 127.0.0.1:5003 check
  95. #server app4 127.0.0.1:5004 check
  96.  
  97. #-------------------------------------------------------------------
  98. # round robin balancing postgresql
  99. #-------------------------------------------------------------------
  100. listen postgres
  101. bind *:5000
  102. maxconn 100
  103. option tcp-check
  104. server postgresql_node1 10.200.19.50:5432 check
  105. server postgresql_node2 10.200.19.51:5432 check
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement