With Galera (Percona Cluster or MariaDB Cluster), it is sometimes advisable to not route traffic to a node during a backup due to the node already being under a heavier load. In these situations, it may be wise to not route traffic there until the backup is complete.
Since the default /usr/bin/clustercheck script did not have the option of doing this, we created a modified version. The below script looks for the presence of the xtrabackup tool running in the process list. If it is found, the clustercheck script returns the appropriate exit code (502) which signals the load balancer to not route traffic its way. The script could easily be modified to look for the presence of programs/tools in the process list.
We hope others will find it useful.
#!/bin/bash # clustercheck.sh # # Script to make a proxy (ie HAProxy) capable of monitoring Percona XtraDB Cluster nodes properly # # Modified by Itchy …[Read more]