multiple mysql instances in a cluster

Latest response

Can anyone tell me what the best approach to building a cluster ha with multiple instances of MySQL Or for having multiple servers accessing the same MySQL instance (diff databases of course)?

I have two pairs of servers in an active-standby in a redhat cluster.

App1/2 have Service A running that requires MySQL Database A access
App3/4 have Service B running that requires MySQL Database B access

Option1:
One MySQL instance with both pairs having access to the MySQL service and databases A (app1/2) and database B (app3/4)

Option2:
MySQL service instance for App1/2 accessing database A and MySQL service instance for App3/4 accessing database B.

I'm running RHEL 6.4 on all the servers and the databases will be on a shared SAN.

Is there any performance differences with one option over the other?

Thanks,
Shane

Responses

Hello,
I can try to comment a bit from the RHEL High Availability Add On side of things, but keep in mind that I'm not a MySQL specialist, so we may need someone else to comment from that perspective and say if there's a preferred approach with respect to the database layout.

My suggestion would be to split things out to as fine a granularity as you can get, for the sake of simplified management. In other words, I would set app1, app2, app3, and app4 all up with their own independent services (assuming none of them need to share other resources like file systems or IPs), and then to have MySQL A and MySQL B running in distinct instances each with their own service. This gives you the flexibility to move, start and stop, or otherwise manage the distinct pieces of this puzzle without affecting the others. If you needed to do maintenance on MySQL A, then you'd only have to take an outage on app1 and app2, but could leave MySQL B and app3 and app4 up and running. If they were managed in one instance, this would be more difficult, if not impossible.

As far as performance goes, there wouldn't be any strong considerations from the HA side that would influence the single-versus-multiple instance decision. The cluster resources will each perform status checks periodically and with more resources this means more status checks, but this really won't matter much because:

  • The only serious check mysql resources perform during status is to look at the pid file, and
  • The interval on these status checks for mysql are a minute apart, which would mean minimal work for the server to do even with 2 instances to check.

Hopefully these points will help in your configuration of the cluster. But as I said, from a MySQL perspective there may be more considerations, so you may want to continue to evaluate if there's any significant difference between the two approaches. I'll see if I can find a specialist on that side to offer more input there. Let us know if you have any questions.

Regards,
John Ruemker, RHCA
Senior Software Maintenance Engineer
Global Support Services
Red Hat, Inc.

Close

Welcome! Check out the Getting Started with Red Hat page for quick tours and guides for common tasks.