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

Collation of relevant knowledge points of mysql master and slave

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

Share

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

This article mainly explains the "mysql master and slave related knowledge points collation", the article explains the content is simple and clear, easy to learn and understand, the following please follow the editor's ideas slowly in depth, together to study and learn "mysql master and slave related knowledge points collation" bar!

First, the reasons that cause the database to stop:

A, mysqld often ends abnormally

B. The disk space is full

C, disk failure

D, server power failure

Second, the features and precautions of the master-slave synchronization function of MySQL:

A, master refers to the server that receives two types of modification and query statements issued by the client.

B. Slave (Slave) refers to the server that does not receive update requests from the client, but only updates the data through linkage with Master.

Synchronous data synchronization, asynchronous data synchronization:

A. In order to achieve synchronization, two processes are set up in Slave to work at the same time, namely, "Imax O process" and "SQL process".

B. The Icano process is responsible for putting the data (update log) obtained from Master into the relay log file for recording.

C, the SQL thread reads the relay log and executes the query

Fourth, why do you need two threads?

The main purpose is to reduce synchronization latency. If only one thread is assigned and the processing of SQL is time-consuming, then data cannot be copied from Master during processing SQL statements.

5. Binary log and relay log

A, "binary log" is generated in Master, and relay log is generated in Slave

B. Only the statements that modify the data are recorded in the binary log, but not the statements of the query class (do not modify the database). In addition to being used for synchronization, binary will also be used to save the updated statements in the backup.

C. Binary is not in text format and cannot be opened and viewed directly. You need to use mysqlbinlog to convert it to text format under the command line.

D, relay log means that the I / O thread of Slave saves the update log on Slave after obtaining the update log from Master (recording the data requested by the modification statement).

E. The relay log is the same as the binary log, but unlike the binary log, when it is not needed, the relay log is automatically deleted by the SQL thread and does not need to be deleted manually

Thank you for your reading, the above is the content of "collation of relevant knowledge points of mysql master and subordinate". After the study of this article, I believe you have a deeper understanding of the collation of relevant knowledge points of mysql master and subordinate, 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

Database

Wechat

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

12
Report