Databases Reference
In-Depth Information
state transfer, and a host of other things. You will also be able to take nodes offline for
operations such as rolling schema changes in the future.
Replication-Based Redundancy
Replication managers are tools that attempt to use standard MySQL replication as a
building block for redundancy. 11 Although it is possible to improve availability with
replication, there is a “glass ceiling” that blocks MySQL's current asynchronous and
semisynchronous replication from achieving what can be done with true synchronous
replication. You can't guarantee instantaneous failover and zero data loss, nor can you
treat all nodes as identical.
Replication managers typically monitor and manage three things: the communication
between the application and MySQL, the health of the MySQL servers, and replication
relationships between MySQL servers. They either alter the configuration of load bal-
ancing or move virtual IP addresses as necessary to make the application connect to
the proper servers, and they manipulate replication to elect a server as the writable node
in the pseudo-cluster. In principle, it's not complicated: just make sure that writes are
never directed to a server that's not ready for writes, and make sure to get replication
coordinates right when promoting a replica to master status.
This sounds workable in theory, but our experience has been that it doesn't always
work so well in practice. It's too bad, really, because it would sometimes be nice to
have a lightweight set of tools to help recover from common failures and get a little bit
higher availability on the cheap. Unfortunately, we don't know of any good toolset that
accomplishes this reliably at the time of writing. We'll mention two replication man-
agers in a moment, 12 but one is new and the other has a lot of issues.
We've also seen many people try to write their own replication managers. They usually
fall into the same traps that have snared others before them. It's not a great idea to roll
your own. Coaxing good behavior from asynchronous components with oodles of fail-
ure modes you've never personally experienced, many of which simply cannot be un-
derstood and handled appropriately by a program, is very hard, and it's riddled with
opportunities to lose data. In fact, a machine can begin with a situation that could be
fixed by a skilled human, and make it much worse by doing the wrong thing.
The first replication manager we want to mention is MMM ( http://mysql-mmm.org ) .
The authors of this topic don't all agree on how suitable this toolkit is for production
deployment (although the original author of the toolkit has opined that it's not trust-
worthy). Some of us think it can be helpful in some cases in manual-failover mode, and
others would rather never use it in any mode. It is certain, however, that many of our
11. We're being careful to avoid confusion in this section. Redundancy is not the same thing as high
availability.
12. We're also working on a solution that's based on Pacemaker and the Linux-HA stack, but it's not ready
to mention in this topic. This footnote will self-destruct in 10..9..8..
 
Search WWH ::




Custom Search