Skip to content

Instantly share code, notes, and snippets.

@alexwoolford
Created July 23, 2019 13:56
Show Gist options
  • Save alexwoolford/c39143803f87c5681538579a1e5d74ff to your computer and use it in GitHub Desktop.
Save alexwoolford/c39143803f87c5681538579a1e5d74ff to your computer and use it in GitHub Desktop.
HA Proxy config file for load balanced MariaDB Galera Cluster
global
log /dev/log local0
log /dev/log local1 notice
chroot /var/lib/haproxy
stats timeout 30s
user haproxy
group haproxy
daemon
defaults
log global
mode http
option httplog
option dontlognull
timeout connect 5000
timeout client 480m
timeout server 480m
listen stats
bind *:9000
mode http
stats enable
stats realm Haproxy\ Statistics
stats uri /haproxy?stats
stats auth admin:admin
listen galera-cluster
balance source
bind *:3306
mode tcp
option tcpka
option mysql-check user haproxy_check
balance roundrobin
server galera01.woolford.io 10.0.1.31:3306 check
server galera02.woolford.io 10.0.1.32:3306 check
server galera03.woolford.io 10.0.1.33:3306 check
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment