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

How to maintain the metadata of master-slave information in MySQL

2025-01-16 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >

Share

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

This article introduces how to maintain the metadata of master and slave information in MySQL. The content is very detailed. Interested friends can use it for reference. I hope it will be helpful to you.

1. Instances * are single-point instances, which are those test environments, data flow nodes or businesses with low business priority. These services allow data loss, or even environment reconstruction, with a basic backup. We can first divest this kind of business, and then we can bypass these nodes when we deal with them. For example, for these nodes, we may not need backup, may not need daily backup, do not need incremental backup at all, binlog backup, according to this plan, after confirming this information. There is a basis for the backup and recovery to be completed in the later stage. If it doesn't take a long time, * finds that the business priority is not high, and the performance-to-price ratio of doing things is greatly reduced.

two。 The second dimension is the role of the database. In fact, the role of the database cannot be strictly classified as Master,Slave. In fact, there can be more types. For example, a single point of business can be classified as SingleDB. If it is a relay node (show master status or show slave status has a dual role), we can classify it as RelayDB. If it is a master database or a slave database, it is Master,Slave, if it belongs to a cluster environment of MHA or MGR, etc. In fact, this role can be clearer. We need to subtract this part of information, that is, the environment of MHA or MGR. This kind of information can be classified as cluster information. We can count other information according to the four dimensions of SingleDB,RelayDB,Master,Slave.

To achieve this function, there are some skills that need to be added.

We need two scripts here:

1) learn the role of the instance through IP and port information (Master,Slave,RelayDB,SingleDB, etc.)

2) through the information of Slave and RelayDB to get the information of Master, the highlight is here, through this information we can clearly achieve a replication diagram, and even see some unexpected problems.

For example, in the following IP information, the database role is the relay node RelayDB (both Master and Slave)

We searched for the last two paragraphs of IP to get a basic list below.

If we deliberately maintain such a relationship, it is easy to get confused or unaware of the existence of such a cascade relationship, but if we abstract the data, we will soon be able to get such a diagram. It turned out to be such a cascade relationship. In this way, the role of the relay node 124.16 and the relationship between upstream and downstream are very clear, so from this point of view, it is easy to draw a conclusion whether we need to back up the data of 124.76.

This is the end of the metadata about how to maintain master-slave information in MySQL. I hope the above content can be helpful to you and learn more knowledge. If you think the article is good, you can share it for more people to see.

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

Database

Wechat

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

12
Report