mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-27 07:02:11 +00:00
8776f1b3a0
The MySQL check has been revamped to be able to send real MySQL data, and to avoid Aborted connects on MySQL side. It is however backward compatible with older version, but it is highly recommended to use the new mode, by adding "user <username>" on the "mysql-check" line. The new check consists in sending two MySQL packet, one Client Authentication packet, with "haproxy" username (by default), and one QUIT packet, to correctly close MySQL session. We then parse the Mysql Handshake Initialisation packet and/or Error packet. It is a basic but useful test which does not produce error nor aborted connect on the server. (cherry picked from commit a1e4dcfe5718311b7653d7dabfad65c005d0439b)
30 lines
733 B
INI
30 lines
733 B
INI
# This is a test configuration.
|
|
# It requires a mysql server running on local port 3306.
|
|
|
|
global
|
|
maxconn 500
|
|
|
|
defaults
|
|
contimeout 1000
|
|
clitimeout 5000
|
|
srvtimeout 5000
|
|
retries 1
|
|
option redispatch
|
|
|
|
listen stats
|
|
bind :8080
|
|
mode http
|
|
stats enable
|
|
stats uri /stats
|
|
|
|
listen mysql_1
|
|
bind :3307
|
|
mode tcp
|
|
balance roundrobin
|
|
option mysql-check user haproxy
|
|
server srv1 127.0.0.1:3306 check port 3306 inter 1000 fall 1
|
|
# server srv2 127.0.0.2:3306 check port 3306 inter 1000 fall 1
|
|
# server srv3 127.0.0.3:3306 check port 3306 inter 1000 fall 1
|
|
# server srv4 127.0.0.4:3306 check port 3306 inter 1000 fall 1
|
|
|