当前位置:网站首页>J3:Redis主从复制
J3:Redis主从复制
2022-07-26 18:06:00 【土拨鼠饲养员】
主从一致性
AOF和RDB可以让数据少丢失,但是减少服务的中断需要增加冗余副本
主从第一次同步
主从复制使用RDB不用AOF是因为 AOF文件比较大(还会包含一个Key的重复操作),ROB是经过压缩的二进制,文件小,执行快
从:replicaof 主ip 主port
如果有很多的从库,都需要主机同步的话,会影响主库的性能,所以有 主-从-从 模式
主从网络断开之后,主从库会采用增量复制的方法,使用了repl_backlog_buffer 缓冲区
- 主从断连之后,主库的操作会写入replication buffer,也会写入repl_backlog_buffer
- repl_backlog_buffer 主库会记录自己写的位置,从库会记录读的位置。
- 主库写的偏移量是master_repl_offset,从库已复制的偏移量是slave_repl_offset

- 从库恢复之后,会发给主库psync,把slave_repl_offset 发送给主库,主库会判断两个直接差了多少

- 可以调整
repl_backlog_size的大小(默认1M),增加缓冲区的大小
边栏推荐
- 2022年流动式起重机司机考试试题模拟考试平台操作
- 2022年焊工(初级)操作证考试题库及模拟考试
- Leetcode notes: biweekly contest 83
- How many pairs can an array of leetcode simple questions form
- SMMU carding
- [MySQL from introduction to proficiency] [advanced chapter] (VIII) clustered index & non clustered index & joint index
- 2022t elevator repair examination questions and online simulation examination
- MES系统最全介绍来了
- What aspects should be considered in the selection of MES system?
- MapReduce(二)
猜你喜欢

Daorayaki | product principles of non-financial decentralized application

JS uses readLine to realize terminal input data

PMP每日一练 | 考试不迷路-7.26(包含敏捷+多选)

Some time series modeling strategies (I)

Seata 入门简介

(ICLR-2022)TADA! Time adaptive convolution for video understanding

MySQL learning notes -2. how to improve the query performance of SQL statements

Database expansion can also be so smooth, MySQL 100 billion level data production environment expansion practice

Brand new! Uncover the promotion route of Ali P5 Engineer ~p8 architect

2022T电梯修理考试题及在线模拟考试
随机推荐
5款WPS Office最佳海外替代品
MySQL learning notes -2. how to improve the query performance of SQL statements
Tensorflow-GPU 1.15安装
Gongfu developer community is settled! On July 30!
Brian behrendorf, general manager of openssf Foundation: it is estimated that there will be 420million open sources in 2026
MySQL - multi table query and case explanation
Racher deploys kubernetes cluster
SMMU carding
.net CLR GC dynamic loading transient heap threshold calculation and threshold excess calculation
实用工具网站推荐
How to become an excellent test / development programmer? Focus on planning and then move
Racher deploys kubernetes cluster
Agenda express | list of sub forum agenda on July 27
MySQL学习笔记-2.如何提高sql语句的查询性能
Sentinel isolation and degradation
MySQL - 多表查询与案例详解
Is it safe for CSC qiniu members to open preferential accounts? I don't know if it's the lowest Commission
FTP protocol
JS使用readline来实现终端输入数据
【MySQL从入门到精通】【高级篇】(八)聚簇索引&非聚簇索引&联合索引
