Skip to content

Commit

Permalink
Added a failover only writer proxy into the HA proxy config, setup a …
Browse files Browse the repository at this point in the history
…stats page for HA proxy and updated the readme.
  • Loading branch information
jayjanssen committed May 24, 2012
1 parent 7deb713 commit 3ea7875
Show file tree
Hide file tree
Showing 2 changed files with 26 additions and 8 deletions.
7 changes: 5 additions & 2 deletions Readme
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,12 @@ vagrant up percona3
And this is all, you have now 3 servers running Percona XtraDB Cluster !


These recipes also install GLB (Galera Load Balancer) on percona1.
These recipes also install HAProxy on percona1. One for writes (single cluster node) and one for reads (rr of all cluster nodes).

You can read more on shinguz's post : http://www.fromdual.com/mysql-and-galera-load-balancer
See cluster status: http://192.168.70.2:9999/

Writes: 192.168.70.2:4306
Reads: 192.168.70.2:5306


Note: SElinux is disabled, there is a selinux policy file included that allows the server to start but the other nodes aren't yet able to sync, I need to investigate...
Expand Down
27 changes: 21 additions & 6 deletions modules/haproxy/files/xtradb_cluster.cfg
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# this config needs haproxy-1.4.20
# this config needs haproxy-1.4.19

global
log 127.0.0.1 local0
Expand All @@ -16,17 +16,32 @@ defaults
option tcplog
option dontlognull
retries 3
redispatch
option redispatch
maxconn 2000
contimeout 5000
clitimeout 50000
srvtimeout 50000

listen mysql-cluster 0.0.0.0:4306
listen cluster-writes 0.0.0.0:4306
mode tcp
balance roundrobin
option httpchk

server percona1 192.168.70.2:3306 check port 9200 inter 12000 rise 3 fall 3
server percona2 192.168.70.3:3306 check port 9200 inter 12000 rise 3 fall 3
server percona3 192.168.70.4:3306 check port 9200 inter 12000 rise 3 fall 3
server percona1 192.168.70.2:3306 check port 9200 inter 12000 rise 3 fall 3 backup
server percona2 192.168.70.3:3306 check port 9200 inter 12000 rise 3 fall 3 backup
server percona3 192.168.70.4:3306 check port 9200 inter 12000 rise 3 fall 3 backup

listen cluster-reads 0.0.0.0:5306
mode tcp
balance roundrobin
option httpchk

server percona1 192.168.70.2:3306 check port 9200 inter 12000 rise 3 fall 3
server percona2 192.168.70.3:3306 check port 9200 inter 12000 rise 3 fall 3
server percona3 192.168.70.4:3306 check port 9200 inter 12000 rise 3 fall 3


listen admin_page 0.0.0.0:9999
mode http
balance roundrobin
stats uri /

0 comments on commit 3ea7875

Please sign in to comment.