Skip to content

Instantly share code, notes, and snippets.

@jayjanssen
Last active December 13, 2015 16:58
Show Gist options
  • Save jayjanssen/4944530 to your computer and use it in GitHub Desktop.
Save jayjanssen/4944530 to your computer and use it in GitHub Desktop.
PXC haproxy config example
global
log 127.0.0.1 local0
log 127.0.0.1 local1 notice
maxconn 4096
uid 99
gid 99
daemon
defaults
log global
mode tcp
balance leastconn
option httpchk
option tcplog
option dontlognull
retries 3
option redispatch
option nolinger
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000
listen cluster-reads *:5306
server node1 192.168.70.2:3306 check port 9200
server node2 192.168.70.3:3306 check port 9200
server node3 192.168.70.4:3306 check port 9200
listen cluster-writes *:4306
server node1 192.168.70.2:3306 track cluster-reads/node1
server node2 192.168.70.3:3306 track cluster-reads/node2 backup
server node3 192.168.70.4:3306 track cluster-reads/node3 backup
# Stats interface
listen lb_stats *:9999
mode http
balance roundrobin
stats uri /
stats realm "HAProxy Stats"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment