Created
October 31, 2014 00:50
-
-
Save cdolek/a015abc3c09808fb14b7 to your computer and use it in GitHub Desktop.
haproxy v0.5 configuration for mysql cluster load balancing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
global | |
log 127.0.0.1 local0 notice | |
chroot /var/lib/haproxy | |
user haproxy | |
group haproxy | |
# daemon | |
defaults | |
log global | |
# mode http | |
option tcplog | |
option dontlognull | |
option redispatch | |
retries 2 | |
maxconn 2000 | |
timeout connect 3000 | |
timeout client 5000 | |
timeout server 5000 | |
listen mysql-cluster 127.0.0.1:3306 | |
mode tcp | |
option tcpka | |
balance roundrobin | |
option mysql-check user haproxy_check | |
server db1 192.168.1.1:3306 check | |
server db2 192.168.1.2:3306 check | |
server db3 192.168.1.3:3306 check backup # like down | |
listen web-interface 0.0.0.0:8080 | |
mode http | |
stats enable | |
stats uri / | |
stats realm Strictly\ Private | |
stats auth someuser:somepassword | |
stats auth Another_User12352488767342:passwd34598797234 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment