当前位置:网站首页>Redis master-slave structure and application scenarios
Redis master-slave structure and application scenarios
2022-06-28 07:55:00 【star++】
summary
Generally speaking, the master-slave structure is used to achieve high availability , That is, when the primary server goes down , Switch to the slave server immediately . The master-slave structure has many advantages , such as : High availability , Read write pressure separation ; It also brings problems , The master-slave data may be inconsistent , Cause dirty data to be read .redis Since the master-slave structure is supported , Naturally, these problems also exist , We can see redis How to solve these problems .
principle

explain : Normal master-slave synchronization structure , The slave node simply executes replicaof Command is enough

explain : One of them salve Dropped the line or hung up ( Generally speaking , The master and slave are in a network segment , It is unlikely to be disconnected , There is a high probability of downtime ), This
When master The newly accepted log cannot be sent to this slave, Lead to master-slave synchronization delay ,master Will temporarily put the newly accepted command into
repl_backlog_buffer( Ring buffer ),master_repl_offset As the number of requests increases
Long ,slave_repl_offset The record is slave Synchronized location , wait for salve Network recovery , Continue to synchronize the remaining logs .

explain : The master-slave structure is generally designed to prevent master Downtime , Then it involves choosing a new master, Resynchronization issues .redis It is the use of sentinels to
New election master, The election process is probably to eliminate the nodes with poor network first , Then, according to the priority of the node configuration , Then judge the synchronization progress , The last is
Find the first to go online, that is ID The smallest . After the election ,
边栏推荐
猜你喜欢

Source code analysis of kubernetes' process of deleting pod

Software design of resistance test board

ACM notes

Sentinel mechanism of redis cluster

Kubelet garbage collection (exiting containers and unused images) source code analysis

es6箭头函数中return的用法

【js】-【DFS、BFS应用】-学习笔记

Section VI UART of zynq

"Three routines" of digital collection market

The solution of "user account control to continue, please enter administrator user name and password" appears in win10 Professional Edition
随机推荐
What is EC blower fan?
ACM notes
Is it safe to open an account on Dongfang fortune
How to insert a single quotation mark into a table as a data type in Oracle pl/sql
Block transmission by golang gin framework
How to configure DDR3 of dm8148
Today's notes 22/1/7
软件测试与质量期末复习
推荐系统系列精讲(第五讲): 排序模型的调优实践
Unity-UI-shadow组件
Is it reliable for securities companies to register and open accounts? Is it safe?
分析 NFT 项目的 5 个指标
HJ字符串排序
sql分析(查询截取分析做sql优化)
asp. Net datalist to display product information and pictures
【js】-【节流、防抖函数】
卸载重装最新版mysql数据库亲测有效
HJ删除字符串中出现次数最少的字符
Study notes 22/1/17
Ambari (VIII) --- ambari integrated impala document (valid for personal test)