0

I have a small cluster of 2 x Apache/PHP servers running HAProxy, connecting to 2 x MySQL clustered servers. Sites are served from both Apache servers and DNS RR is relied upon for failover and crude load balancing.

Diagram:

Apache/PHP -- HAProxy -- MySQL
                      \/
                      /\
Apache/PHP -- HAProxy -- MySQL

(excuse my lack of ASCII art skill!)

The trouble I'm facing is that periodically there is a fault with the network between one of the Apache/PHP/HAProxy servers and both MySQL servers.

Since Apache is still running, however, it starts serving errors whenever a request depends on MySQL being available (as you'd expect!).

Ideally, Apache should be stopped if MySQL is unavailable, and possibly restarted automatically when MySQL becomes available again.

This would then cause client requests to be handled by the other Apache server without any manual intervention.

Is anyone aware of a package which could be configured to do this out-of-the-box?

Michael
  • 1
  • 1

1 Answers1

0

Pacemaker is a cluster resource manager that can be configured to enforce location and ordering constraints for your services. If some monitor operation fails, the cluster could restart dependent services in the specified order.

You can find more information about the Pacemaker project on the ClusterLabs website: http://clusterlabs.org/

Matt Kereczman
  • 1,899
  • 9
  • 12