Skip to content

Instantly share code, notes, and snippets.

@yamingd
Forked from artschwagerb/haproxy mysql and www
Created August 25, 2014 03:10
Show Gist options
  • Save yamingd/cc9b7ed14d5e67994817 to your computer and use it in GitHub Desktop.
Save yamingd/cc9b7ed14d5e67994817 to your computer and use it in GitHub Desktop.
global
log 127.0.0.1 local0 notice
maxconn 20000
user haproxy
group haproxy
defaults
log global
mode tcp
option dontlognull
retries 3
maxconn 19500
option redispatch
#option forwardfor
#option httpclose
timeout connect 5s
timeout client 60s
timeout server 60s
timeout queue 60s
frontend mysql
bind :3306
default_backend mysql_farm
backend mysql_farm
mode tcp
option tcplog
option mysql-check user haproxy
balance roundrobin
server mysql1 172.16.3.151:3306 check
server mysql2 172.16.3.152:3306 check
frontend www
bind :80
default_backend www_farm
backend www_farm
mode http
balance roundrobin
server www1 172.16.3.153:80 check
server www2 172.16.3.154:80 check
listen stats 0.0.0.0:8080
mode http
stats enable
stats uri /haproxy?stats
stats realm Strictly\ Private
stats auth haproxy:password123
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment