Skip to content

Instantly share code, notes, and snippets.

@bitcloud
Forked from gburd/haproxy.conf
Last active August 29, 2015 13:57
Show Gist options
  • Save bitcloud/9356617 to your computer and use it in GitHub Desktop.
Save bitcloud/9356617 to your computer and use it in GitHub Desktop.
# Documentation for HAProxy
# http://code.google.com/p/haproxy-docs/w/list
# http://haproxy.1wt.eu/download/1.2/doc/architecture.txt
# NOTES:
# open files limits need to be > 256000, use ulimit -n to set (on most POSIX systems)
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 256000
chroot /var/lib/haproxy
user haproxy
group haproxy
spread-checks 5
daemon
quiet
defaults
log global
option dontlognull
option redispatch
option allbackups
maxconn 256000
timeout connect 5000
backend riak_rest_backend
mode http
balance roundrobin
option httpchk GET /ping
option httplog
server riak1 riak1.<FQDN>:8098 weight 1 maxconn 1024 check
server riak2 riak2.<FQDN>:8098 weight 1 maxconn 1024 check
server riak3 riak3.<FQDN>:8098 weight 1 maxconn 1024 check
server riak4 riak4.<FQDN>:8098 weight 1 maxconn 1024 check
frontend riak_rest
bind 127.0.0.1:8098
mode http
option contstats
default_backend riak_rest_backend
backend riak_protocol_buffer_backend
balance leastconn
mode tcp
option tcpka
option srvtcpka
server riak1 riak1.<FQDN>:8087 weight 1 maxconn 1024 check
server riak2 riak2.<FQDN>:8087 weight 1 maxconn 1024 check
server riak3 riak3.<FQDN>:8087 weight 1 maxconn 1024 check
server riak4 riak4.<FQDN>:8087 weight 1 maxconn 1024 check
frontend riak_protocol_buffer
bind 127.0.0.1:8087
mode tcp
option tcplog
option contstats
option tcpka
option srvtcpka
default_backend riak_protocol_buffer_backend
listen stats 0.0.0.0:9001 #Listen on all IP's on port 9000
mode http
balance roundrobin
timeout client 5000
timeout connect 4000
timeout server 30000
#This is the virtual URL to access the stats page
stats uri /haproxy_stats
#Authentication realm. This can be set to anything. Escape space characters with a backslash.
stats realm HAProxy\ Statistics
#The user/pass you want to use. Change this password!
stats auth admin:passwordhere
#This allows you to take down and bring up back end servers.
#This will produce an error on older versions of HAProxy.
stats admin if TRUE
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment