~ VIP mysql architecture automatically switches ideas

Mysql object is achieved in a high availability cluster VIP switching does not involve compensation data
Two basic environment python3.0 +
Three specific three parts
A start condition is detected
   1 to detect whether a cluster machine down mode select 1
    2 detects whether or not the host library approach is to use the VIP binding vip connected
    3 detect whether normal copy from the library and delays
    Detecting whether the relay 4 is turned on binlog log writes from the library
    5 detect whether the cluster has opened the way to enhance the semi-synchronous
    6 detects whether cluster replication opens up GTID
Two HA handover procedure
    1 main library down the machine if it fails three times to try determination
    2 remove original owners VIP, if an SSH words
     3 Select new master mode is determined from the slave node
4 opens new master node read and write functions
5 VIP binding on the new master
6 statement generation change in the log
7 to send alarm messages
Three new primary determination condition
1 Select the cluster from the library to join the electoral groups, with the proviso that sql_thread state to YES
    2 Comparative read binlog (name and postion) ordered according to the cluster members, the head member selected
Three pairs of further new master determination, the determination condition is second_master_behind
If 0, ensure sql_thread has been applied fully part relay-log
4 The third step is to judge the success, then take the following actions for the new primary
1 set global read_only = off write off
2 ifconfig vip VIP binding
Four points to note about
1 cloud environments and multi-instance environment is not suitable for VIP environment, so this article does not apply, but the same general principles
2 data-dependent enhancement of semi-sync compensation, it is necessary
3 Prior to bind VIP needs arpping VIP, prevent split brain problems
4 uses a cluster way to start a process to prevent problems affect each other, of course, if your python high capacity, can be freely modified
5 监控好你的从库健康情况,防止高可用切换的时候无健康从库可用
五 关于应用场景情况
1 对于集群都出现延时的情况比较少见
2 一旦发生这种情况而又导致切换
重要场景 会坚持relay-log应用完才会进行切换,业务响应排后
非重要场景 不考虑relay-log应用情况进行直接
六 总结
本文章只是提供一个思路,如有意见可以联系本人进行修订,欢迎

Guess you like

Origin www.cnblogs.com/danhuangpai/p/11563124.html