7.12.5.1. Configuring HAProxy using the native Basic Check

✅ RECOMMENDED

  • BRIDGE MODE - ❌ NOT RECOMMENDED

    When the Connector is in Bridge mode, using the native test check will generate errors in the Tungsten Connector logs (as well as in the MySQL error log with MySQL versions 8+).

  • PROXY MODE - ✅ RECOMMENDED, with Limitations

    When the Connector is in Proxy mode, it will be considered as up as long as it is running, even if no database backend is available. This has a very low impact on the cluster as the connection will only affect the connector, but it does not guarantee the application will get a proper connection to the database due to the TCP-only nature of the test.

Here is a practical example for deploying the HAProxy's native TCP-based check option.

#---------------------------------------------------------------------
# backend
#---------------------------------------------------------------------
listen connector
    bind *:3306
    mode tcp
    option tcpka   # enables keep-alive both on client and server side
    balance roundrobin
    server conn1 db1:3306 check inter 5s rise 1 fall 1 weight 3 maxconn 5000
    server conn2 db2:3306 check inter 5s rise 1 fall 1 weight 3 maxconn 5000
    server conn3 db3:3306 check inter 5s rise 1 fall 1 weight 3 maxconn 5000

This solution does NOT require adding a user to MySQL.