当前位置:网站首页>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

边栏推荐
- oracle数据库导入数据步骤
- Flink deployment mode and runtime architecture (session mode, single job mode, application mode, jobmanager, taskmanager, yarn mode deployment and runtime architecture)
- Redis RDB和AOF
- STM32 development of practical series 7-data Porter DMA
- Unity 游戏保护“大练兵”,一文读懂游戏事前防御
- JMeter learning experience
- Jerry's CMD_ SET_ BT_ Name command format [chapter]
- flink 物理分区( 随机分区、 轮询分区、重缩放分区、 广播、 全局分区、自定义分区 )
- ftp服務器:serv-u 的下載及使用
- oracle删除用户后,却还可以使用该用户登录
猜你喜欢
随机推荐
13. Explanation of reentrantlock, reentrantreadwritelock and stampedlock
Zabbix安装及配置应用
flink GROUPING SETS多维度聚合、设置Table state 到期时间
13、ReentrantLock、ReentrantReadWriteLock、StampedLock讲解
Installation and use of saltstack
JVM optimization
知物由学 | 行为时序建模在社交引流黑产识别中的应用
mysql的主从复制
Redis data type Daily use Scenarios
JVM优化
8. 18 arhat enhancements for atomic operations
中国联通 22春招 群面
记录一次jvm GC过程
Flick grouping sets multidimensional aggregation and setting table state expiration time
JMeter 学习心得
记一次codis内存清理
Workload management of Splunk best practices
Solving the problem of data garbled in sqlserver connection database (Chinese table)
11、Synchronized与锁升级
Jerry's aicmd_ SET_ BT_ Addr command format [chapter]









