当前位置:网站首页>Redis 集群面试题
Redis 集群面试题
2022-07-17 04:48:00 【teayear】
主从复制原理
从服务器连接主服务器,发送 SYNC 命令。主服务器接收到 SYNC 命名后,开始执行
BGSAVE 命令生成 RDB 文件并使用缓冲区记录此后执行的所有写命令。主服务器
BGSAVE 执行完后,向所有从服务器发送快照文件,并在发送期间继续记录被执行的写命
令。从服务器收到快照文件后丢弃所有旧数据,载入收到的快照。主服务器快照发送完毕后
开始向从服务器发送缓冲区中的写命令。
从服务器完成对快照的载入,开始接收命令请求,并执行来自主服务器缓冲区的写命令(从
服务器初始化完成)。主服务器每执行一个写命令就会向从服务器发送相同的写命令,从服
务器接收并执行收到的写命令(从服务器初始化完成后的操作)。
优点
支持主从复制,主机会自动将数据同步到从机,可以进行读写分离。为了分载 Master 的
读操作压力,Slave 服务器可以为客户端提供只读操作的服务,写服务仍然必须由 Master
来完成 Slave 同样可以接受其它 Slaves 的连接和同步请求,这样可以有效的分载 Master
的同步压力 Master Server 是以非阻塞的方式为 Slaves 提供服务。所以在 Master-Slave
同步期间,客户端仍然可以提交查询或修改请求。Slave Server 同样是以非阻塞的方式完
成数据同步。在同步期间,如果有客户端提交查询请求,Redis 则返回同步之前的数据。
缺点
Redis 不具备自动容错和恢复功能,主机从机的宕机都会导致前端部分读写请求失败,
需要等待机器重启或者手动切换前端的 IP 才能恢复。主机宕机,宕机前有部分数据未能及
时同步到从机,切换 IP 后还会引入数据不一致的问题,降低了系统的可用性。Redis 较难
支持在线扩容,在集群容量达到上限时在线扩容会变得很复杂。
边栏推荐
- Analysis of network attack detection technology for NDN
- Demo analysis of sliding conflict external interception method
- OpenLDAP自定义schema
- Cannot find module ‘process‘ or its corresponding type declarations.
- 对称加密与非对称加密
- PowerDesigner displays comment comments
- Only when the data analysis report is written in this way can we really understand the data
- EasyExcel简单使用
- Golang reverse slice code example
- DNS原理及解析过程
猜你喜欢

Impersonate the server for requests

Summary of black screen problems in unity UMP packaging
![[Unity] 交互之双击](/img/28/8c9c3dd9de413ff8e6373ea111b04f.png)
[Unity] 交互之双击

Only when the data analysis report is written in this way can we really understand the data

Project structure of wechat applet

Real time Bi (IV) low cost data quasi real time processing idea

JS modal box

Mature threads should know how to refuse

C list set object de duplication LINQ de duplication with time de duplication
![[unity] interactive double click](/img/28/8c9c3dd9de413ff8e6373ea111b04f.png)
[unity] interactive double click
随机推荐
Android kotlin custom LinearLayout
MySQL InnoDB transaction related records
物业小区高校水电抄表充值管理系统
leetcode977. Square of ordered array
mysql8.026-- 视图(下)
Week 2022/7/16
[TA frost wolf _may - "hundred people plan"] art 2.1 DCC tool chain and engine tool chain
Gin framework principle
Wechat applet source code of high imitation Netease cloud music UI
kettle5.4问题记录
As a result, all system modifications of the company will be upgraded
JS中Class类的静态属性和静态方法
探索:制药厂系统网络时钟同步(NTP时间同步服务器)
Beidou clock server (NTP server) makes the time of college entrance examination more accurate
TiDB学习笔记【初阶】
异或和加密方式的解密的复现
【TA-霜狼_may-《百人计划》】基础渲染光照介绍(一)
The n-beats model was released in 2020 and is 3% better than the winner of the M4 competition!
Policy mode replaces if else
[pits]packets go:428: busy buffer invalid connection