HAProxy Enterprise Documentation 1.9r1

MySQL Health Checks

HAProxy Enterprise can health check MySQL database servers. The check is valid if the server responds with a successful result message. Two modes exist:

  • check the MySQL handshake packet

  • test Client Authentication

In the following example, we check a MySQL handshake by adding the option mysql-check directive:

backend be_myapp
   option mysql-check
   server srv1 10.0.0.1:3306 check
   server srv2 10.0.0.2:3306 check

Add a user parameter to option mysql-check for the health check probe to send a Client Authentication packet:

backend be_myapp
   option mysql-check user hapee-lb
   server srv1 10.0.0.1:3306 check
   server srv2 10.0.0.2:3306 check

Next up

PostgreSQL Health Checks