codership / glb

Galera Load Balancer - a simple TCP connection proxy and load-balancing library
GNU General Public License v2.0
153 stars 51 forks source link

glb should understand galera group communication and exclude node #31

Open shinguz opened 3 years ago

shinguz commented 3 years ago

glb should understand galera group communication protocol and exclude node if it is not in state synced (donor/desynced)

ayurchen commented 12 months ago

Hi Oli, sorry I missed this ticket. There is an option for glbd to run external script that checks the state of a destination (glbd is a generic TCP router, so it does not know what sort if destination is there):

./glbd -w exec:"mysql.sh -d 2 -utest -ptestpass" -t 2 3306 192.168.0.1 192.168.0.2

so here you have -w (--watchdog) option with an argument exec:"mysql.sh -d 2 -utest -ptestpass" which means that it will execute external script with certain options. There is a sample mysql.sh script that should work for most users in /usr/share/doc/glbd/examples/mysql.sh

This can be configured in /etc/sysconfig/glbd//etc/default/glbd like:

OTHER_OPTIONS="-w exec:'/path/to/mysql.sh -d 2 -utest -ptestpass'"
srikanthjeeva commented 12 months ago

hi @ayurchen, its better that Galera Load balancer has the capability to understand current cluster and exclude the node that is not part of cluster. We had this issue last week in production, the node was not part of cluster (mysql was running but due to network issue it went away from cluster) but still glb was sending requests to this node.