Skip to content

Instantly share code, notes, and snippets.

@pingles
Created May 3, 2011 18:39
Show Gist options
  • Save pingles/953926 to your computer and use it in GitHub Desktop.
Save pingles/953926 to your computer and use it in GitHub Desktop.
Using HAProxy to balance Hive service requests across multiple backends
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 1000
daemon
user haproxy
group haproxy
defaults
log global
option dontlognull
option redispatch
retries 3
listen stats :8080
balance
mode http
contimeout 5s
clitimeout 50s
srvtimeout server 50s
stats enable
listen hive :10000
contimeout 1800000
clitimeout 14400000
srvtimeout 14400000
mode tcp
option tcplog
balance roundrobin
server hive1 localhost:10001 maxconn 1 check inter 20000
server hive2 localhost:10002 maxconn 1 check inter 20000
server hive3 localhost:10003 maxconn 1 check inter 20000
server hive4 localhost:10004 maxconn 1 check inter 20000
server hive5 localhost:10005 maxconn 1 check inter 20000
server hive6 192.168.35.10:10001 maxconn 1 check inter 20000
server hive7 192.168.35.10:10002 maxconn 1 check inter 20000
server hive8 192.168.35.10:10003 maxconn 1 check inter 20000
server hive9 192.168.35.10:10004 maxconn 1 check inter 20000
server hive10 192.168.35.10:10005 maxconn 1 check inter 20000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment