当前位置:网站首页>Master-slave replication of MySQL
Master-slave replication of MySQL
2022-06-11 12:28:00 【log. Info (Xiao Lu)】
https://blog.csdn.net/bai_ye_/article/details/118851804
docker See here for details
Mysql Master-slave architecture of Can ease mysql Data storage and access pressure , Previous one mysql Nodes do both read and write operations
Now? The master node performs write operations Read from the node This can improve the concurrency of the database and the pressure of the phase database

If there are three MySQL, a mater Write only , Two sets of salve Only responsible for reading operations , Can't performance be greatly improved ?
So master-slave replication 、 Read write separation is to support more concurrency in the database .


mysql Of binlog It's not just the master and the slave , It can also be used to cache synchronization scenes ,
such as canal Can simulate a slave node towards mysql launch binlog Sync , Then drop the data into es perhaps redis,
Expansion of cluster construction The master-slave synchronization we set up is aimed at the configuration of the whole database , In actual production , Sometimes we don't need training for the whole library , You only need to synchronize some particularly important libraries or tables
We need to do further configuration
Note that the flow direction of the configured read / write separation data is single Only from m--->s, That is, you can only synchronize from the master server to the slave server The slave server cannot update to the master server ,mysql It can only give us a master-slave architecture
But the specific read-write separation is implemented by our business We can use ShardingSphere

Cluster expansion We are now 1 Lord 1 from , We now need to add from point , Achieve one master and many slaves , We just need to add a node to
binlog Just copy
But our cluster has been running for some time There will be a problem , Previous binlog There's no way to recover , Therefore, when we add a new node, we need to perform a data replication operation ,( Just synchronize the previous data to the new node )
Semi-synchronous replication
because mysql Replication is asynchronous . It's in this Dump Thread send binlog The slave node is asynchronous
The master node feeds back the results to the client I do not know! At this time dump Whether the thread executes successfully , If the master node down Behind the machine , The data has not been synchronized to the slave node , will Data loss

So there is a semi synchronous mechanism The master node is written binlog After logging Synchronize slave nodes , Receive slave node ack Respond to the client later
however If from node 10s There's no response in I will synchronize the client directly ( Use asynchronous replication )


The delay of master-slave replication

边栏推荐
- 一些比较的常用网站
- 解决Splunk kvstore “starting“ 问题
- 非标自动化设备制造企业,如何借助ERP系统实现快速精准报价?
- 2. Completablefuture
- 记一次codis内存清理
- Live app source code, and the status bar and navigation bar are set to transparent status
- Construction of specflow environment
- CMD of Jerry's AI protocol_ SET_ BT_ Addr [chapter]
- Installation and use of saltstack
- China Unicom 22 spring Games Group
猜你喜欢

8、原子操作类之18罗汉增强

2022 vmvare download and installation tutorial on the latest official website (ultra detailed)

12. AQS of abstractqueuedsynchronizer

Flink physical partition (random partition, polling partition, rescaling partition, broadcast, global partition, custom partition)

9、聊聊ThreadLocal

9、聊聊ThreadLocal

非标自动化设备制造企业,如何借助ERP系统实现快速精准报价?

机械设备制造企业,如何借助ERP系统做好委外加工管理?

Redis數據類型日常使用場景

JVM优化
随机推荐
Harmonyos application development -- General app interface framework appgeneralframework[app general framework][api v6]
Flip window join, interval join, window cogroup
Flink physical partition (random partition, polling partition, rescaling partition, broadcast, global partition, custom partition)
Splunk 健康检查之关闭THP
一些比较的常用网站
JMeter 学习心得
2、CompletableFuture
Troubleshoot Splunk kvstore "starting"
Sulley fuzzer learning
7. CAS
Splunk健康检查orphaned searches
11. Synchronized and lock escalation
Redis RDB和AOF
Yarn switch ResourceManager (failed to connect to server:8032 retries get failed due to exceeded maximum)
Record a JVM GC process
How Oracle exports data to CSV (Excel) files
The secret behind the Splunk bucket
知物由学 | 行为时序建模在社交引流黑产识别中的应用
石头科技:研发实力和过硬品质 助力扫地机器人产业升级
11、Synchronized与锁升级