Several types of primary Orchestrator MySQL database failover

Orchestrator fault MySQL database master switch is switched into manual and automatic switching.
Manual switching is divided into recover, force-master-failover, force-master-takeover and graceful-master-takeover.

1. Automatic switching

Automatically switch fails after the primary library, automatically promoted new primary library, so for the failover.

Automatic switching conditions and subject to the following constraints:

  • Main library is no downtime cluster failover. If you want to ignore the cluster fails, you can set the downtime.
  • In a failure of the active failover cluster is not (i.e. in_active_period = 1)
  • Only the configuration items RecoverMasterClusterFilters match failover cluster

It will detect the primary cycle status.
Automatic switching will scan cycle fault, a fault if found, it will failover condition is satisfied.

DETAILED fault detection and switching () is implemented by CheckAndRecover, specifically call:

  • GetReplicationAnalysis (), scanning fault
  • executeCheckAndRecoverFunction (), fault recovery

2. The manual switch

Manual switch comprising: recover, force-master-failover, force-master-takeover and graceful-master-takeover.

Manual switching condition mentioned limitations and restrictions are not automatically switched.

2.1 recover

and the failure to recover the main library of candidate instance candiateKey parameters, call CheckAndRecover (), failover.
The failure of the primary designated library must be a failure, malfunction is confirmed, if not failure, not to switch.

2.2 force-master-failover

Regardless of whether the cluster master database fault, the switching operation will follow-up, the user needs to confirm the failure has occurred.

Specific steps:

  • (1) failure in the scanning forceAnalysisEntry()-->GetReplicationAnalysis()
  • (2) recovery ForceExecuteRecovery(analysisEntry, nil,false)-->executeCheckAndRecoverFunction(), the candidate master does not specify the library

Finally, the old main library as a separate instance DB.

2.3 force-master-takeover

Ibid., Requires the user to determine the fault yourself.

force-master-takeover, the only point different from the force-master-failover is, force-master-takeover candidate master tape library (i.e. candidate), and the candidate cluster master library must be directly connected to the main library from the library.
The other with force-master-failover.

2.3 graceful-master-takeover

This switching method is aimed at: the old main library is normal, need to upgrade the new main library, the old main library as the library.

Specific steps include:

  • (1) Check the main library of candidate
    • Candidate of the main library must be directly connected to the main library cluster from the library
    • Candidate of the main library, is not prohibited to enhance the main library (that is, not the promotion rule must not)
    • Master candidate library, no delay is too large (more than 20s)
  • (2) failure in the scanning,forceAnalysisEntry()-->GetReplicationAnalysis()
  • (3) 调用hooks:PreGracefulTakeoverProcesses
  • (4) If more than one copy of the cluster, the old main library moved from the library to the candidate under the main library
  • (5) Stop the main library of candidate replication master library on candidatestop slave
  • (6) set the old main library read-only
  • (7) a candidate master bank to catch the old main library ( start slave until)
  • (8) fault recovery, forming the new primary libraryForceExecuteRecovery(analysisEntry, &destination.Key, false)-->executeCheckAndRecoverFunction()

  • (9) The old main library to become the new primary database from the library
  • (10) 调用hooks: PostGracefulTakeoverProcesses

It is called graceful, is not a failure because the old main library, the first candidate of the main library will catch up with old main library. Finally, the old main library as a new main library (but not implemented from the library start slave).
The force-master-failover, force- master-takeover will not be the old main library as a new main library from the library, the old main library to be isolated instances.

Guess you like

Origin www.cnblogs.com/lanyangsh/p/11409955.html