Considerations for master-slave switchover and heartbeat mechanisms

Source: Internet
Author: User

We often hear about the master-slave database architecture, and the heartbeat mechanism is also a common term in life. For those who are not satisfied with vocabulary, I always want to know how these two words represent.
1. Database Switching
The replication function of MySQL can be used to implement master-slave, master-slave, dual-master-slave, and other highly available database clusters, however, some blogs or Article What is said in this section is "master-slave switchover". How can this problem be switched? It will not be said how to switch, so it is empty talk (of course it is not ruled out here, this may be common sense, I have little knowledge, I will accumulate ). My preliminary thinking about this switchover is: Since it is to switch the master, is it not to do some processing on the master. It can be found that one of the characteristics of my thinking is that in the master and slave directions, I think about it from the master perspective. As a result, I don't know how to do it. Later, I saw change in a blog.
The Master-to-command turned out to be clear: my direction is wrong. Since the master has been crash, why should I consider the solution from the master's perspective? Therefore, from the slave point of view, if you use the change master on the slave to a ready (or another master in dual-master), won't you switch over? Alternatively, you can enable the bin-log function of a server Load balancer instance, and then use the change master to command to set other Server Load balancer master nodes to this salve. Is the master switchover complete? I think of this level. It is said that the master-slave switchover is just like this!
2. Heartbeat Mechanism
In fact, the heartbeat mechanism and the master-slave switchover are not a thing, and the relationship is not big, but I think about it when I understand the database switchover. Is widely spread:

The first process is heartbeat. It is a mechanism that slave uses to report its own health status to the master, or a mechanism that the master uses to obtain the health status of the slave. The reason why I put the master-slave switchover and heartbeat mechanism together is that I think why do I need the master-slave switchover? How do we know when the master-slave switchover is completed? Right, you need to know the machine status to clearly know the machine crash. So won't heartbeat be able to play a role here? You can also use heartbeat to automatically switch the master, so that the two questions discussed in this blog will be unified.
About the implementation of heartbeat, there is an open source software called heartbeat: http://www.linux-ha.org/wiki/Main_Page/
Here By The Way to recommend a blog, the introduction of more detailed: http://www.cnblogs.com/google4y/archive/2011/08/12/2136720.html

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.