当前位置:网站首页>Redis主从同步机制
Redis主从同步机制
2022-07-24 00:14:00 【一只小小狗】
Redis主从同步机制
Redis主从同步机制

全量复制
在slave从服务初始化阶段,需要将master主服务器上所有复制都复制一份,流程:
- 从服务器连接主服务器,并发送psync命令
- 主服务器收到psync命令后,执行bgsave命令生成RDB文件,并且在缓冲区中记录之后所有的记录操作
- master执行完bgsave后,master将RDB文件发送给slave,并在此阶段内继续在缓冲区内写操作
- slave在接收到RDB文件前 ,会将自身的数据全部丢弃,载入RDB
- master发送完毕,会向slave 的缓冲区发 写入执行命令
- slave 完成对RDB的载入,开始接受命令请求,并执行缓冲区的命令
增量复制
在slave完成初始化且开始正常工作后,master发生的写操作会同步到slave上
增量复制的话只复制挤压缓存区中数据,如果主从节点offset差距过大,可能会导致必须使用全量复制。
如有错误欢迎指正
边栏推荐
- [wechat applet] design and interactive implementation of auction product details page (including countdown and real-time update of bids)
- Browser cannot access Minio
- 【细节】radio 标签 ,更换 默认选中的背景色
- QT create a background mask, pop up the child window, and the background of the parent window turns black and dark
- Nacos
- Splicing of.Net distribution with outlook mail format and table
- ansible命令自动补全
- 2022牛客多校联赛第二场 题解
- 复制客服微信号,前往微信添加,拨打电话
- Sentinel链路方式流控失效解决
猜你喜欢

My meeting of OA project (query)

【HCIP】MGRE环境下OSPF实验,含多进程双向重发布及OSPF特殊区域

链表——206. 反转链表(这题很重要)
C language explanation series -- understanding of functions (2) how to use functions to exchange the values of two integer variables

权重分析——CRITIC权重法

474-82(8、221、300)

Error handling of DGS

数据驱动之Excel读写
![[microservice Architecture] distributed transactions](/img/3b/f35f060e146858e40ce8a5e0d1a154.png)
[microservice Architecture] distributed transactions

Sentinel link mode flow control failure solution
随机推荐
vulnhub wpwn: 1
Space shooting lesson 07: add graphics
Deep learning 9 feedforward neural network 2: realize feedforward neural network and model optimization
NGFW的Portal认证实验
Nacos
[for loop if conditional statement] summary
文本和图片的绘制、数据存储、localStorage、sessionStorage、cookie三者的区别
[microservice Architecture] distributed transactions
学习的快乐很多
腾讯将关闭“幻核”,数字藏品领域发展是否面临阻力?
深度学习之 9 前馈神经网络 基本概念
Esp8266 - at command + network transparent transmission
【HCIP】MGRE环境下OSPF实验,含多进程双向重发布及OSPF特殊区域
.NET下发同Outlook邮件格式以及表格的拼接
【语音合成】TensorFlowTTS 中文文本转语音
[hcip] OSPF experiment under mGRE environment, including multi process bidirectional republication and OSPF special area
[Android kotlin] property, getter and setter
Jenkins 使用sonarqube构建流水线代码审查项目
[details] radio label, change the default selected background color
最长递增子序列变种[深刻理解最长递增序列]