How the MHA works

Source: Internet
Author: User


How the MHA works


1. Inspection phase

<1>: monitoring to Maser Goway

<2> multi-route detection

<3>: Repeated detection 4 times (this number is fixed, cannot be modified)

<4> detect if SSH is OK

<5>: Detection configuration (mainly detects which machines are in the cluster, which machines can be accessed normally, which machines are dead,binlog,

Candidate Master,relay_log_purge,read_only)

<6> Detect master State again


2. Close the service phase

To prevent data anomalies, close the server phase. You can call the master_ip_failover_scripts script to shut down the server

3. Recovery phase

(1). master Recovery phase

<1>: Find the nearest slave and the oldest slave.

<2>. Copy the binlog that was not sent and save it on the manager (T1).

<3>: Use the latest slave to restore the other slave so that all slave are at the same point in time

<4> Select a new Master

<5>: Compare T1 and master, generate diff Binlog, and save Binlog and Pos at this time (T2)

You can call master_ip_failover_scripts to open the service at this time

(2). Slave recovery phase

and will T1 and slave contrast to generate difference binlog, and do

(3). Slave Information Modification phase

(1). Perform reset slave all on Newmaster

(2). Perform change master Binlog and Pos on other slave in T2

(3). Modify the MHA configuration file

4. Inspection phase (Reporting phase)

You can call the Report_scripts script to check if the new cluster is healthy



The specific logs are as follows:


650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M02/82/CC/wKioL1dhNOiD9gFuAAJORaOQj2A140.png "title=" 1.png " alt= "Wkiol1dhnoid9gfuaajoraoqj2a140.png"/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/82/CE/wKiom1dhM-exLbb6AAHsvskY1YU392.png "style=" float: none; "title=" 2.png "alt=" Wkiom1dhm-exlbb6aahsvsky1yu392.png "/>

650) this.width=650; "src=" Http://s4.51cto.com/wyfs02/M00/82/CC/wKioL1dhNPyBSbTnAAHdBp2EXQs444.png "style=" float: none; "title=" 3.png "alt=" Wkiol1dhnpybsbtnaahdbp2exqs444.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M01/82/CE/wKiom1dhM-mD-41EAAIFzK9AXZk074.png "style=" float: none; "title=" 4.png "alt=" Wkiom1dhm-md-41eaaifzk9axzk074.png "/>

650) this.width=650; "src=" Http://s3.51cto.com/wyfs02/M00/82/CE/wKiom1dhM-mAntJEAAC_JX46T4s423.png "style=" float: none; "title=" 5.png "alt=" Wkiom1dhm-mantjeaac_jx46t4s423.png "/>








This article is from the "SQL Server MySQL" blog, so be sure to keep this source http://dwchaoyue.blog.51cto.com/2826417/1789635

How the MHA works

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.