Forum Discussion

Lionel_Gautier's avatar
Lionel_Gautier
Icon for Nimbostratus rankNimbostratus
Jun 26, 2019

LTM - MySQL - Disable Pool Member when Slave SQL process isn't running

Hello,

 

One issue has been raised to me by my fellow developers.

 

We set up a Virtual Server a few years ago, that is only used for some SQL SELECT commands.

 

The virtual server is used one pool as its ressource, and that pool is hosting two nodes. Both nodes are part of a Master-Slave SQL partnership.

 

The monitor of the pool is the TCP port 3306 (MySQL).

 

The node that has the highest priority is the SLAVE, in order to prevent the MASTER from getting overwhelmed with SELECT requests.

 

Unfortunately, the replication sometimes fails between the MASTER and the SLAVE. When that happens, the monitor is still up as the MySQL service is still running on the SLAVE.

 

The consequence is that the data requested by the applications is not up to date.

 

Is there a way I can add a rule that would monitor the Slave_SQL_Running thread on the SLAVE so that the member is marked down if it's not running.

 

The SELECT commands would then be redirected to the MASTER.

 

I'm new to the LTM and I was wondering if I could use one iRule to achieve this.

 

I'm sorry if it's already been asked before. I browsed the existings questions but I didn't quite find what I'm looking for.

 

Many thanks in advance.

 

Kind regards,

Lionel

1 Reply

  • Hello,

     

    Is there a chance that your team develops a small HTML web page that gets updated with this information on the server? If that's the case you can then create a custom http monitor that looks for a Specific string and manage the state of the pool member.

     

    We solved a similar case with this approach, I know that it's not the prettiest but it works. If not I guess that you will have to work with custom monitors, don't think that this can be done by iRules (As far as I know, at least).

     

    Regards,