Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What is the method of smooth migration of MySQL middleware cluster

2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

Shulou(Shulou.com)05/31 Report--

This article mainly explains "what is the method of smooth migration of MySQL middleware cluster". The content of the explanation is simple and clear, and it is easy to learn and understand. Please follow the editor's train of thought to study and learn "what is the method of smooth migration of MySQL middleware cluster".

Recently, a set of servers in the MySQL cluster environment is about to be overinsured. In order to avoid some additional problems, we need to consider the migration plan of the server in advance. But in the current online business, it is difficult to apply for maintenance time, and the tolerance time for online changes is very short. Generally, there are fault-tolerant mechanisms in the business layer, such as timeout, fault-tolerant times and so on. So it is hoped that the whole solution is controllable and the change time is clear for the business side.

The migration plan of the entire cluster is to carry out server peer-to-peer replacement according to the 1:1 mode, which means that there are 30 servers and so on. According to the previous practice, the overall migration time is basically controlled within 5 seconds.

The overall deployment architecture of the cluster is as follows, the connection layer uses a Consul-based load balancing mechanism, and the data sharding node uses an one-master-one-slave mode.

In the migration, because the slave library is not connected to the business by default, the replacement of the corresponding slave library can be smoothly implemented, that is, it can be topped up with a new server to become a new slave library. If the IP is guaranteed to remain unchanged, the overall topology will remain unchanged.

Next, consider adding a data slave node, which is based on the new cascading replication from the library node, and the overall structure is as follows:

Before the migration, the existing middleware needs to be reduced, which can be gradually reduced to 1 middleware node. This process can be realized by using the spare connection pool technology, or by actively triggering the application reconnection mechanism.

In the process of switching, the original Consul mode can be downgraded to an IP-based mode, and the data sharding node connected by the middleware P1 can be mapped to S1-S4 first during the switch. this process is simply to restart the middleware node P1, which will gradually release the connection on the M1-M4 during the restart process, in order to ensure data consistency. It is necessary to configure the two-way replication of data between M1murS1 and M2murS2 and between M3murS3 and M4murS4.

After the switch is completed, it becomes a simple one-master-slave topology, which is relatively easy to understand as a whole, so it is integrated into the new server group.

Add the middleware node and turn on the Consul service, so that the business will return to the same usage pattern as before.

Of course, the whole process is the most simplified step, and rigorous thinking and verification are needed in each step.

Thank you for your reading, the above is the content of "what is the method of smooth migration of MySQL middleware cluster". After the study of this article, I believe you have a deeper understanding of what is the method of smooth migration of MySQL middleware cluster, and the specific use needs to be verified in practice. Here is, the editor will push for you more related knowledge points of the article, welcome to follow!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report