当前位置:网站首页>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 .
边栏推荐
- MySQL驱动中关于时间的坑
- MySQL basic operation and comprehensive instance project based on MySQL basic operation
- Prometheus + AlertManager 消息预警
- The financing demand of 129 million yuan was released, and the roadshow of the Dake city project continued to irrigate the "good seedlings" of scientific innovation
- When I look at the source code, what am I thinking?
- ROS2/ROS1开发过程中的一些记录
- Day 14: continued day 13 label related knowledge
- “12306”的架构到底有多牛逼?
- 3D模型格式全解|含RVT、3DS、DWG、FBX、IFC、OSGB、OBJ等70余种
- 当Synchronized遇到这玩意儿,有个大坑,要注意
猜你喜欢

The outsourcing company "mixed" for two years, and I only did five things seriously. Now I get byte offer smoothly.

Data security and privacy computing summit - development and application of security intersection in privacy Computing: Learning

会议OA之会议通知

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

ES6 event binding (v-on usage)

I was stunned by this question that I browsed 746000 times

Prometheus + alertmanager message alert

ES6事件绑定(v-on用法)

The financing demand of 129 million yuan was released, and the roadshow of the Dake city project continued to irrigate the "good seedlings" of scientific innovation

NPM install reports an error: eperm: operation not permitted, rename
随机推荐
redis为什么快,消息队列,单线程
7/28 Gauss elimination to solve linear equations + Gauss elimination to solve XOR linear equations + find the combination number II
如何把thinkphp5的项目迁移到阿里云函数计算来应对流量洪峰?
Never pass a request to an asynchronous thread. There is a hole
On Multithreading
防止勒索软件攻击数据的十种方法
Kubesphere multi node installation
[quality] code quality evaluation standard
Time pit in MySQL driver
6 years of testing experience, teaching you how to test ~ how to control the project
Remember error scheduler once Asynceventqueue: dropping event from queue shared causes OOM
JMeter's BeanShell generates MD5 encrypted data and writes it to the database
Polygon point test
Responsive dream weaving template home decoration building materials website
ROS2/ROS1开发过程中的一些记录
HTTP缓存
time_wait和close_wait产生原因
How to use RPA to achieve automatic customer acquisition?
Even PostgreSQL problem: expected authentication request from server, but received V
响应式织梦模板户外露营类网站