Tungsten Connector can be used in combination with an HAProxy installation to provide a high-availability connection to the underlying connectors that then provide an intelligent connection to the datasources within the cluster.
There are multiple ways to monitor MySQL health via HAProxy, two which are recommended and one which is not (mysql-check, because this method will flood the Connector logs with connection failure messages):
check
- an HAProxy-native test
✅ RECOMMENDED
Adding check
to each server line
tells HAProxy to perform regular health checks on that backend server.
By default, it will try opening a TCP connection and if the TCP
handshake succeeds, HAProxy considers that server "up" and if it fails
(e.g., no SYN/ACK), the server is marked "down" until it passes again.
Without the check option, HAProxy assumes the server is always available
and will continue sending traffic to it even if it’s unreachable.
External Check Script
✅ RECOMMENDED
This script is normally launched via xinetd, and allows for custom monitoring of the database health. This is the preferred method when full database visibility is needed.
mysql-check
- an HAProxy-native
test
❌ NOT RECOMMENDED
If you specify a username, the check consists of sending two MySQL packets, one Client Authentication packet, and one QUIT packet, to correctly close the MySQL session. HAProxy then parses the MySQL Handshake Initialisation packet and/or Error packet. It is a basic but useful test which does not produce errors or aborted connects on the server.
If you don't specify a username (which is deprecated by HAProxy and not recommended), the check only consists in parsing the MySQL Handshake Initialization packet or Error packet, HAProxy sends nothing in this mode.
The mysql-check method (with or without a user specified) will flood the Connector logs with connection failure messages.
The mysql-check method (with or without a user specified) does NOT check for database presence nor database consistency. To do this, we must use an external check script (via xinetd) which is explained below.
At the end is a an example haproxy.cfg
file for a
composite cluster, see: Section 7.12.5.4, “Example HAProxy Configuration File”
Exhaustive documentation can be found directly on the HA Proxy documentation page.
Additional configuration examples are located on the HA Proxy config tutorials page.