Skip to content

Instantly share code, notes, and snippets.

@dongyi
Created April 30, 2015 08:54
Show Gist options
  • Select an option

  • Save dongyi/5bb7f9839ee1c3f81b92 to your computer and use it in GitHub Desktop.

Select an option

Save dongyi/5bb7f9839ee1c3f81b92 to your computer and use it in GitHub Desktop.

Revisions

  1. dongyi created this gist Apr 30, 2015.
    99 changes: 99 additions & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,99 @@
    #---------------------------------------------------------------------
    # Example configuration for a possible web application. See the
    # full configuration options online.
    #
    # http://haproxy.1wt.eu/download/1.4/doc/configuration.txt
    #
    #---------------------------------------------------------------------

    #---------------------------------------------------------------------
    # Global settings
    #---------------------------------------------------------------------
    global
    # to have these messages end up in /var/log/haproxy.log you will
    # need to:
    #
    # 1) configure syslog to accept network log events. This is done
    # by adding the '-r' option to the SYSLOGD_OPTIONS in
    # /etc/sysconfig/syslog
    #
    # 2) configure local2 events to go to the /var/log/haproxy.log
    # file. A line like the following can be added to
    # /etc/sysconfig/syslog
    #
    # local2.* /var/log/haproxy.log
    #
    log 127.0.0.1 local6

    chroot /var/lib/haproxy
    pidfile /var/run/haproxy.pid
    maxconn 265535
    user haproxy
    group haproxy
    daemon

    # turn on stats unix socket
    stats socket /var/lib/haproxy/stats

    #---------------------------------------------------------------------
    # common defaults that all the 'listen' and 'backend' sections will
    # use if not designated in their block
    #---------------------------------------------------------------------
    defaults
    mode tcp
    log global
    option tcplog
    option dontlognull
    option redispatch
    retries 3
    timeout http-request 10s
    timeout queue 1m
    timeout connect 200ms
    timeout client 1m
    timeout server 1m
    timeout check 3s
    maxconn 102400



    listen hades :443
    mode tcp
    option tcplog
    #balance leastconn
    #balance source
    balance roundrobin

    server socket01 127.0.0.1:9001 check

    listen s310 :11688
    mode tcp
    option tcplog
    #balance leastconn
    #balance source
    balance roundrobin

    server socket01 127.0.0.1:10466 check
    server socket02 127.0.0.1:10467 check
    server socket03 127.0.0.1:10468 check
    server socket04 127.0.0.1:10469 check
    server socket05 127.0.0.1:10470 check
    server socket06 127.0.0.1:10471 check
    server socket07 127.0.0.1:10472 check
    server socket08 127.0.0.1:10473 check

    listen s308 :11788
    mode tcp
    option tcplog
    #balance leastconn
    #balance source
    balance roundrobin

    server socket01 127.0.0.1:10566 check
    server socket02 127.0.0.1:10567 check
    server socket03 127.0.0.1:10568 check
    server socket04 127.0.0.1:10569 check
    server socket05 127.0.0.1:10570 check
    server socket06 127.0.0.1:10571 check
    server socket07 127.0.0.1:10572 check
    server socket08 127.0.0.1:10573 check