Created
January 31, 2014 16:33
-
-
Save rds13/8735677 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# see https://github.com/postrank-labs/goliath/wiki/HAProxy | |
global | |
pidfile /var/run/haproxy.pid | |
log 127.0.0.1 local0 info | |
maxconn 64000 | |
defaults | |
clitimeout 60000 # maximum inactivity time on the client side | |
srvtimeout 60000 # maximum inactivity time on the server side | |
timeout connect 8000 # maximum time to wait for a connection attempt to a server to succeed | |
stats enable | |
stats auth admin:password | |
stats uri /monitor | |
stats refresh 5s | |
option httpchk GET / | |
retries 5 | |
option redispatch | |
# errorfile 503 /path/to/503.text.file | |
balance roundrobin # each server is used in turns, according to assigned weight | |
frontend http | |
bind :80 | |
mode http | |
monitor-uri /haproxy # end point to monitor HAProxy status (returns 200) | |
default_backend servers | |
frontend tcp | |
bind :9000 | |
option tcplog | |
option contstats | |
default_backend tcpservers | |
backend tcpservers | |
balance leastconn | |
server tcp1 192.168.22.6 check port 7070 inter 60s rise 2 fall 10 fastinter 1s maxconn 5000 | |
server tcp2 192.168.22.7 check port 7070 inter 60s rise 2 fall 10 fastinter 1s maxconn 5000 | |
server tcp3 192.168.22.9 check port 7070 inter 60s rise 2 fall 10 fastinter 1s maxconn 5000 | |
# http://www.tokiwinter.com/highly-available-load-balancing-of-apache-tomcat-using-haproxy-stunnel-and-keepalived/ | |
backend servers | |
option httpchk OPTIONS / | |
option forwardfor | |
option http-server-close | |
appsession JSESSIONID len 52 timeout 3h | |
# option httpclose | |
### server srv0 ${IP}:${PORT} weight 1 maxconn 100 check inter 4000 | |
twillouer
commented
Feb 10, 2014
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment