Skip to content

Instantly share code, notes, and snippets.

@roblayton
Last active August 29, 2015 14:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save roblayton/44b23dee2d248e021643 to your computer and use it in GitHub Desktop.
Save roblayton/44b23dee2d248e021643 to your computer and use it in GitHub Desktop.
HAProxy config file for a MySQL cluster
global
log 127.0.0.1 local0 notice
maxconn 2000
user haproxy
group haproxy
defaults
log global
mode http
retries 3
option redispatch
timeout connect 5000
timeout client 10000
timeout server 10000
listen mysql-cluster
bind 127.0.0.1:3306
mode tcp
option mysql-check user haproxy_check
balance leastconn
server mysql1 192.168.50.11:3306 check
server mysql2 192.168.50.12:3306 check
listen stats
bind 127.0.0.1:8080
mode http
option httplog
option dontlognull
stats enable
stats uri /
stats realm Strictly\ Private
stats auth user1:password
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment