当前位置:网站首页>Master-slave replication and its principle
Master-slave replication and its principle
2022-07-29 02:35:00 【Meme_ xp】
Redis The replication function of is to support data synchronization among multiple databases . The main database can be read and write , When the data in the master database changes, it will automatically synchronize the data to the slave database . The slave database is generally read-only , It will receive data synchronized from the primary database .
1. When starting a slave node , It will send one PSYNC Command to master ;
2. If the slave node is connected to the master node for the first time , Then a full copy will be triggered . At this point, the master node will start a background thread , Start making a copy of RDB Snapshot file ;
3. It will also be from the client side client All newly received write commands are cached in memory .RDB After file generation , The master node will RDB The file is sent to the slave node , The slave node will first RDB File write to local disk , Then load it from the local disk into memory ;
4. Then the master node sends the write command cached in memory to the slave node , Synchronize this data from the node ;
5. If the network between the slave node and the master node fails , The connection is broken , Will automatically reconnect , After connection, the master node will only synchronize some missing data to the slave node .
边栏推荐
- Derivation of Euler angle differential equation
- DevOps 团队如何抵御 API 攻击?
- 7/28 Gauss elimination to solve linear equations + Gauss elimination to solve XOR linear equations + find the combination number II
- Kubesphere multi node installation
- MySQL和Redis的双写一致性
- Responsive dream weaving template home decoration website
- 工程经济学简答题
- Redis主从模式、哨兵集群、分片集群
- 如果非要在多线程中使用 ArrayList 会发生什么?
- 2022/07/28 学习笔记 (day18) 常用API
猜你喜欢

如何利用 RPA 实现自动化获客?

How to use RPA to achieve automatic customer acquisition?

Understand the evolution of redis architecture in one article

Day 15 (VLAN related knowledge)

Remember error scheduler once Asynceventqueue: dropping event from queue shared causes OOM

Chapter 3 business function development (deletion and modification of clue remarks)

Transform okhttp cache with retrofit

FPGA skimming memory (Verilog implementation of ram and FIFO)

Object based real-time spatial audio rendering - Dev for dev column

How much is the report development cost in the application system?
随机推荐
Keil5 open the engineering prompt not found device solution
In depth analysis - Pretreatment
Brief answer of Engineering Economics
How to customize a new tab in Duoyu security browser?
Work queue_ queue
Production scheme and advantages of online 3D digital exhibition hall
3种过期策略
Servlet三种实现方式
响应式织梦模板家装建材类网站
Workflow of wireless vibrating wire acquisition system
数据安全与隐私计算峰会-安全求交集在隐私计算中的发展和应用:学习
Time pit in MySQL driver
How to guarantee password security? How does the secure browser manage passwords?
一文理解分布式开发中的服务治理
深度剖析 —— 预处理
[mqtt from introduction to improvement series | 09] Wireshark packet capturing and analyzing mqtt messages
Chapter 3 business function development (deletion and modification of clue remarks)
Awvs cannot start problem
ES2022 的 8 个实用的新功能
MySQL和Redis的双写一致性