当前位置:网站首页>MySQL master-slave synchronization pit avoidance version tutorial
MySQL master-slave synchronization pit avoidance version tutorial
2022-04-23 16:35:00 【Autumnal equinox fishing fire】
Due to the data synchronization requirements on the project , I've seen a lot recently mysql Master slave synchronized posts , Also followed many posts to build it again , Finally, I found many places that are easy to step on the pit . Let's talk about it from beginning to end
- The master-slave synchronization has strict requirements on the version , Master and slave mysql The version must be consistent
- Please make sure the modified my.ini/my.cnf The file you installed mysql The program uses
Make sure that after two points above , So let's start building master-slave synchronization .
The first is the main end configuration

This part must pay attention to server-id It cannot be the same as the slave configured below .
meanwhile show master status after ,file And position If the parameter is empty , There are two possible situations
1. Modified my.ini file error , Not used by the current service
2. After modifying the file , No service restart
After the primary end is configured successfully , Now let's configure the slave

There are also places where it is easy to step on pits
If the port number of the primary end is not the default 3306, Additional port settings are required . Other settings that need to be changed , You can use commands show slave status\G To view the parameter list
master_log_file and master_log_pos The values of are before running on the host show master status Recorded when File and Position If the result is wrong , say slave The thread is running , Cannot set , In this case , perform mysql>stop slave; stop it slave Threads , Then set the parameters of the connection ; After setting up , perform mysql> start slave; Turn on slave Threads ; perform mysql> show slave status\G ( There's no semicolon ). If appear
Slave_IO_Running: Yes
Slave_SQL_Running: Yes
Represents successful configuration
After the master-slave setting is successful , Under normal circumstances , Synchronization ok , But when the slave network is interrupted or the network fluctuates , because mysql Its own setting problem , After returning to normal from the end network , need 30 Minutes to 60 Minutes to synchronize ( This is also a pit ) If you need to speed up synchronization , Need modification mysql Related parameters

For the specific principle, please refer to https://blog.51cto.com/wwdhks/2103885 This elder brother's post .
To add Individuals found in the tests The slave end is set -slave-net-timeout after , Need to put slave close It won't take effect until you open it again
At the same time, the master-slave mode can also be master-slave to each other , Avoid operating the same table when they are master-slave .
版权声明
本文为[Autumnal equinox fishing fire]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/04/202204231402334722.html
边栏推荐
- 众昂矿业:萤石浮选工艺
- 下载并安装MongoDB
- Creation of RAID disk array and RAID5
- Using JSON server to create server requests locally
- 299. 猜数字游戏
- 浅谈 NFT项目的价值、破发、收割之争
- 建站常用软件PhpStudy V8.1图文安装教程(Windows版)超详细
- DanceNN:字节自研千亿级规模文件元数据存储系统概述
- 1959年高考数学真题
- Hyperbdr cloud disaster recovery v3 Version 2.1 release supports more cloud platforms and adds monitoring and alarm functions
猜你喜欢

Review 2021: how to help customers clear the obstacles in the last mile of going to the cloud?

阿里研发三面,面试官一套组合拳让我当场懵逼

Best practice of cloud migration in education industry: Haiyun Jiexun uses hypermotion cloud migration products to implement progressive migration for a university in Beijing, with a success rate of 1

计组 | 【七 输入/输出系统】知识点与例题

【Pygame小游戏】10年前风靡全球的手游《愤怒的小鸟》,是如何霸榜的?经典回归......

磁盘管理与文件系统

New project of OMNeT learning

Questions about disaster recovery? Click here

Matplotlib tutorial 05 --- operating images

The font of the soft cell changes color
随机推荐
众昂矿业:萤石浮选工艺
linux上啟動oracle服務
昆腾全双工数字无线收发芯片KT1605/KT1606/KT1607/KT1608适用对讲机方案
Phpstudy V8, a commonly used software for station construction 1 graphic installation tutorial (Windows version) super detailed
Detailed explanation of gzip and gunzip decompression parameters
About JMeter startup flash back
G008-hwy-cc-estor-04 Huawei Dorado V6 storage simulator configuration
Homewbrew installation, common commands and installation path
Qipengyuan horizon credible meta universe social system meets diversified consumption and social needs
英语 | Day15、16 x 句句真研每日一句(从句断开、修饰)
Gartner announces emerging technology research: insight into the meta universe
Summary according to classification in sail software
最詳細的背包問題!!!
Force buckle-746 Climb stairs with minimum cost
451. 根据字符出现频率排序
Detailed explanation of UWA pipeline function | visual configuration automatic test
PHP 零基础入门笔记(13):数组相关函数
Install redis and deploy redis high availability cluster
Loading order of logback configuration file
力扣-198.打家劫舍