There are many different ways to lay out cluster nodes across the physical systems. You need to consider many factors in your decision as to what is the best physical layout for your application. The following sections explain some of the benefits and drawbacks of running nodes in different places.
The Simplest Setup
The simplest setup that is possible for a highly available system is two main machines and a third system to hold the management server. On the two main systems, you run your application, a MySQL server, and a data node. These machines handle all the actual processing and execution of the queries.Figure 7.1 illustrates what this basic setup would look like.
Figure 7.1. A basic two-machine setup.
The third machine can be relatively low performance due to the fact that it is running only the management server and does not take part in any of the query process. The only reason you need a third machine is due to network partitioning problems mentioned in previous chapters.
Tim Pearson has ported the management daemon onto the OpenWRT operating system, which runs on some switches. If you have such a switch, you can use this daemon as the management daemon. See http://pcos.dyndns.org for more details.
There are a few main advantages to this setup. The most important aspect is that it doesn't require a lot of hardware, but it still maintains high availability. You can lose any one of the three machines without affecting the availability of the database. Also, the performance is relatively good because most communication can happen locally. Of course, there is network traffic between the servers, but it will be minimal compared to what it would be with more hardware.
The drawback is that this isn't a very scalable solution. It is difficult to add more machines to the environment without having to re-architect the cluster setup.
In many applications, scalability isn't as important as high availability, and this scenario is perfect for those applications. An example would be for a company intranet server for a small or medium-size business. The overall traffic in that scenario is quite small, averaging a few requests per second, but you want to maintain high availability to ensure smooth operations of the company's processes.
One thing to note is that it is possible to start with a setup such as this and then migrate to one of the larger setups mentioned later in this chapter. It might even be possible to do this migration without having to lose availability for the application. As long as you aren't growing beyond the two data nodes, it should be possible to add/move the applications and MySQL servers to different physical locations without shutting down the server.
Web Farm MySQL Farm