当前位置:网站首页>Customer disaster recovery case - a MySQL database migration scheme

Customer disaster recovery case - a MySQL database migration scheme

2022-06-24 04:40:00 dongdonglin

During the construction of customer disaster recovery plan , The customer migrates the database instance to the cloud MySQL Is a very common need . At present, the most commonly used general migration scheme is a more mature one , This scheme can be adopted in the general migration process ; But there is an inconvenient point in the general scheme : Business switching in the migration process is a difficult point , Adjust the business database connection configuration , Switch the read / write data source to CDB Example of IP. The step of adjusting the connection configuration of the business database is likely to store the missing information , The front-end business has been developing for a long time , There are multiple sources that connect to the database , It is difficult to adjust the access source to the target at one time .

General switching scheme :

In the figure, No 3 Step , The business side is required to modify the direction MySQL Of IP.

This scheme provides a migration scheme : By directly modifying the database connection IP, Realize fast business switching , Avoid business front-end redirection IP.

This plan :

HHA yes MySQL Relatively mature solutions for high availability , This article illustrates with examples , Create a database on behalf of the customer .

Switch preconditions :

at present MySQL The console provides modification " Connect VIP" The function of :

This address is MySQL Connection provided VIP, this VIP It can be modified to any unoccupied in the subnet of this instance IP Address . Based on this principle , Require previous source data VIP In the same subnet as the target instance . This is guaranteed by resource planning .

Switching steps :

  1. Pre check . Check that the data synchronization is complete and as expected .
  2. Close target MySQL read-only , Open source MySQL read-only .
  3. Put the source library's MHA Of VIP Release .
  4. The target MySQL Of VIP Change to source VIP.
  1. Log in to the source library ,kill The process of deleting non system accounts .
  2. Observe the business situation , To complete the migration .

matters needing attention : A fallback strategy should be made during the switching process ,3,4 There are certain risks in the process , Careful evaluation is required before operation .

原网站

版权声明
本文为[dongdonglin]所创,转载请带上原文链接,感谢
https://yzsam.com/2021/09/20210907112932513x.html