Skip to content

Instantly share code, notes, and snippets.

@nakato
Created January 7, 2015 03:12

Revisions

  1. nakato created this gist Jan 7, 2015.
    44 changes: 44 additions & 0 deletions haproxy.cfg
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,44 @@
    global
    log 127.0.0.1 local2
    chroot /var/lib/haproxy
    pidfile /var/run/haproxy.pid
    maxconn 4000
    user haproxy
    group haproxy
    daemon
    stats socket /var/lib/haproxy/stats
    tune.bufsize 128000

    defaults
    mode http
    log global
    maxconn 8000
    option httplog
    option dontlognull
    option http-server-close
    option forwardfor except 127.0.0.0/8
    option redispatch
    retries 3
    timeout http-request 10s
    timeout queue 1m
    timeout connect 10s
    timeout client 1m
    timeout server 1m
    timeout check 10s

    listen rabbitmq
    bind 127.0.0.1:5672
    mode tcp
    option tcpka
    timeout client 99999m
    timeout server 99999m
    balance roundrobin
    server rabbit1 192.168.10.1:5672 check inter 5s rise 2 fall 3 on-marked-down shutdown-sessions
    server rabbit2 192.168.10.2:5672 check inter 5s rise 2 fall 3 on-marked-down shutdown-sessions

    listen stats 192.168.10.3:8080
    mode http
    stats enable
    stats uri /stats
    stats realm HAProxy\ Statistics
    stats auth openstack:testing