当前位置:网站首页>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 ,
边栏推荐
- Design of DSP image data stream
- Software design of power control board
- HJ进制转换
- Path alias specified in vite2.9
- Airflow2.1.1 ultra detailed installation document
- Safety training is the greatest benefit for employees! 2022 induction safety training for new employees
- MMR rearrangement (similarity is calculated by editing distance and repeatability)
- Understanding of OPC protocol
- golang gin框架进行分块传输
- HJ字符串排序
猜你喜欢
随机推荐
A single node obtains the lock lock of the order number
SOC serial port configuration
Study notes 22/1/17
Is it reliable to open an account by digging money? Is it safe?
Implementation of commit message standardized control in large projects
Helloword routine for ROS
No suspense about the No. 1 Internet company overtime table
Dataset filling data, and the use of rows and columns
HJ删除字符串中出现次数最少的字符
Is it reliable to register and open an account for stock speculation? Is it safe?
Ambari (VIII) --- ambari integrated impala document (valid for personal test)
8 figures | analyze Eureka's first synchronization registry
sql主從複制搭建
Introduction and several months' experience of extending the solution thanos of Prometheus
Is it safe for flush to open an account online
卸载重装最新版mysql数据库亲测有效
大型项目中的Commit Message规范化控制实现
HJ delete the character with the least number of occurrences in the string
Software design of power control board
Hj21 simple password









