MySQL MHA main library of candidate selection

MHA in the choice of a new primary library will all survive from the library is divided into the following categories:

Survival from the library array: Pick all surviving from the library
The latest from the library array: Pick Master_Log_File + Read_Master_Log_Pos up from the library
Preferably the array from the library: selection parameter candidate_master = survival from a library
Non-candidate from a library array: Pick meet the following conditions:
  1 , the parameter = no_master 1 from the library
  2 , unopened binlog from the library
  3 , more than one replica delay file location (Master_Log_File> Relay_Master_Log_File), or 100 million sites (Read_Master_Log_Pos> Exec_Master_Log_Pos + 100000000 ) from the library

 

Select new main library order

1 : When the "non alternatively from the library array" and when the number is 0 "array preferably from Library", select "New Library from the array" from the first library
 2 : Select the first present in a "library arrays preferably from "and" the latest from the library array "but not in" non-array alternative library from "from library
 3 : select the first present in a" library arrays preferably from "but not in" non alternatively from library array "
 4 : select the first exists in the "latest from the library array" but not in "non-alternative array library from"
 5 : select the first exists in the "survival of the array from the library," but not in "non-candidate from a library array "

 

In simple terms, select the new primary database:

1, all "non-candidate from the library" will not be selected to become the new primary database.

2, when there is a "preferred from the library," select "preferably from a Library" to obtain "master library BINLOG up" in the new primary library from the library.

3, when there is no "preferred from the library," select "Main Library BINLOG up" to become the new primary library from the library.

 

Reference links:

https://blog.csdn.net/n88lpo/article/details/79910203

Guess you like

Origin www.cnblogs.com/gaogao67/p/11106328.html