So, it is possible
to achieve long-distance master-slave replication among multiple clusters.
It is also possible to have several mysqld servers accessing the same cluster and serving
the same clients for redundancy. In the preceding diagram, the MySQL server is a
single point of failure; if it goes down, there is no way for the application to access
the cluster. There are three approaches to handling load balancing and failover when
multiple MySQL servers are involved:
??? Modify the application code to handle failed servers and retry queries to different
servers. Each MySQL server will have its own IP address in this scenario.
??? Use a separate hardware or software load balancer between the application and
the MySQL servers. This will create one Virtual IPaddress (VIP) that will be
directed to one of the physical servers via DNAT. This method is expensive, as
you need at least two load balancers for high availability.
Figure 4-3. MySQL Cluster architecture
Application code
mysqld
(NDB backend)
Management node
Data
node
Data
node
Data
node
Cluster
My SQL API
Load Balancing and High Availability | 123
??? Use a software high-availability solution such as Wackamole (http://www.
backhand.org/wackamole/). This will expose a pool of virtual IPaddresses and
ensure that exactly one live server has each IPaddress at all times. If a server
fails, its VIPs are redistributed among those remaining.
Pages:
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193