MHA high-availability database construction

1. Introduction of MHA

        At present, it is a relatively mature solution in terms of MySQL high availability. It was developed by the Japanese youshimaton. It is an excellent high-availability software for failover and master-slave promotion in the MySQL high-availability environment.

        In the MySQL failover process, MHA can automatically complete the database failover operation within 0~30 seconds, and in the process of failover, MHA can ensure the consistency of the database to the greatest extent to achieve the true meaning High availability.

        When the Master fails, it can automatically upgrade the slave with the latest data to the new Master, and then redirect all other slaves to the new Master. The entire failover process is completely transparent to the application.

1.1 Composition of MHA

  • MHA Manager (Management Node):
  • The Manager can be deployed on a separate machine to manage multiple master-slave clusters, or it can be deployed on a slave node.
  • MHA Node (Data Node):
  • Node runs on each MySQL server. MHA Manager will periodically detect the master node in the cluster. When the master fails, it can automatically upgrade the slave with the latest data to the new master, and then redirect all other slaves to the new one. master.

1.2 Features of MHA

  • Using MySQL 5.5 semi-synchronous replication can greatly reduce the risk of data loss
  • During the automatic failover process, MHA tries to save the binary log from the down main server to ensure that data is not lost to the greatest extent

Guess you like

Origin blog.csdn.net/qq_46480020/article/details/111924230