当前位置:网站首页>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
边栏推荐
- Phpstudy V8, a commonly used software for station construction 1 graphic installation tutorial (Windows version) super detailed
- Meaning and usage of volatile
- MySQL的btree索引和hash索引区别
- Nanny Anaconda installation tutorial
- JMeter installation tutorial and solutions to the problems I encountered
- 通过Feign在服务之间传递header请求头信息
- Ali developed three sides, and the interviewer's set of combined punches made me confused on the spot
- 关于 background-image 渐变gradient()那些事!
- Gartner 發布新興技術研究:深入洞悉元宇宙
- Day (5) of picking up matlab
猜你喜欢

homwbrew安装、常用命令以及安装路径

How to upgrade openstack across versions
![[pyGame games] how did angry birds, a mobile game that became popular all over the world 10 years ago, dominate the list? Classic return](/img/f5/15b3731e75eb4d861bd9d29ae244da.png)
[pyGame games] how did angry birds, a mobile game that became popular all over the world 10 years ago, dominate the list? Classic return

Solution of garbled code on idea console

Nacos detailed explanation, something

文件操作详解(2)

Take according to the actual situation, classify and summarize once every three levels, and see the figure to know the demand

Gartner announces emerging technology research: insight into the meta universe

RecyclerView advanced use - to realize drag and drop function of imitation Alipay menu edit page

Questions about disaster recovery? Click here
随机推荐
力扣-746.使用最小花费爬楼梯
欣旺达:HEV和BEV超快充拳头产品大规模出货
Review 2021: how to help customers clear the obstacles in the last mile of going to the cloud?
昆腾全双工数字无线收发芯片KT1605/KT1606/KT1607/KT1608适用对讲机方案
05 Lua 控制结构
Hyperbdr cloud disaster recovery v3 Version 2.1 release supports more cloud platforms and adds monitoring and alarm functions
Server log analysis tool (identify, extract, merge, and count exception information)
Passing header request header information between services through feign
文件系统读写性能测试实战
299. 猜数字游戏
Custom implementation of Baidu image recognition (instead of aipocr)
There is a problem with the light switch from 1 to 100
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
Gartner 发布新兴技术研究:深入洞悉元宇宙
JSP learning 3
451. 根据字符出现频率排序
Es common query, sorting and aggregation statements
Detailed explanation of gzip and gunzip decompression parameters
Creation of RAID disk array and RAID5
Day (3) of picking up matlab