当前位置:网站首页>Redis集群配置
Redis集群配置
2022-06-10 19:56:00 【飞Link】
一、介绍
- Redis集群实现了对Redis的水平扩容,即启动N个redis节点,将整个数据库分布存储在这N个节点中,每个节点存储总数据的1/N
- Redis集群通过分区(partition)来提供一定程度的可用性(availability):即使集群中有一部分节点失效或者无法进行通信,集群也可以继续处理命令请求
- Redis采用无中心化集群配置
二、集群节点分配原则
- 一个集群至少要有3个节点
- 选项 ``–cluster-replicas 1`表示集群中的每个主节点创建一个从节点
- 分配原则尽量保证每个主数据库运行在不同的IP地址,每个从库和主库不在一个IP地址上
三、slot
- 一个 Redis 集群包含 16384 个插槽(hash slot), 数据库中的每个键都属于这 16384 个插槽的其中一个,集群使用公式 CRC16(key) % 16384 来计算键 key 属于哪个槽, 其中 CRC16(key) 语句用于计算键 key 的 CRC16 校验和 。
- 集群中的每个节点负责处理一部分插槽。 举个例子, 如果一个集群可以有主节点, 其中:
- 节点 A 负责处理 0 号至 5460 号插槽。
- 节点 B 负责处理 5461 号至 10922 号插槽。
- 节点 C 负责处理 10923 号至 16383 号插槽。
三、优点
- 实现扩容
- 分摊压力
- 无中心配置相对简单
四、缺点
- 多键操作是不被支持的
- 多键的Redis事务是不被支持的,lus脚本不被支持
- 由于集群方案出现较晚,很多公司已经采用了其他的集群方案,而代理或者客户端分片的方案想要迁移至redis cluster,需要整体迁移而不是逐步过度,复杂度较大
边栏推荐
- LeetCode:497. Random points in non overlapping rectangles -- medium
- MySQL - common functions
- Self attention and multi head attention
- Is Zhongyan futures a regular platform in China? Is it safe to open an account? Want to open a futures account
- torch. nn. Simple understanding of parameter / / to be continued. Let me understand this paragraph
- View play and earn will lead crypto games astray
- 2台电脑共享一套键盘鼠标
- 牛客网:数组中出现次数超过一半的数字
- Tutoriel Microsoft Word "5", comment changer les marges de page et créer une barre de nouvelles en word?
- Zero trust architecture
猜你喜欢

canvas 高级功能(上)

A small case with 666 times performance improvement illustrates the importance of using indexes correctly in tidb

Pytorch deep learning -- convolution operation and code examples

View play and earn will lead crypto games astray

Microsoft Word 教程,如何在 Word 中更改页面方向、为页面添加边框?

20192407 2021-2022-2 experimental report on Experiment 8 of network and system attack and Defense Technology

pdf.js-----js解析pdf文件實現預覽,並獲取pdf文件中的內容(數組形式)

Pytorch deep learning -- neural network convolution layer conv2d

Software definition boundary (SDP)

Microsoft Word tutorial "5", how to change the margins and create a newsletter column in word?
随机推荐
node(express)实现增删改查、分页等接口
【电脑使用】如何设置没有自启项的软件开机启动
利用阿里云国际购买的服务器搭建个人网站步骤
Pytorch deep learning -- neural network convolution layer conv2d
Lengsuanling, a 30-year tortuous history of IPO of a domestic brand
Li Kou 10821084 solution_ Question of SQL query type
Analysis on rendering principle of mobile terminal
Node (express) implements interfaces such as adding, deleting, modifying, and paging
What is the difference between localhost and 127.0.0.1?
牛客网:数组中出现次数超过一半的数字
游戏兼容性测试(通用方案)
Networkx usage and nx Draw() related parameters
【生成对抗网络学习 其一】经典GAN与其存在的问题和相关改进
在阿里云国际上使用 OSS 和 CDN 部署静态网站
玩艺术也得学数学?
观点丨Play and Earn 会让加密游戏误入歧途
redis设置密码命令(临时密码)
Read the source code of micropyton - add the C extension class module (1)
Kcon 2022 topic public selection is hot! Don't miss the topic of "favorite"
Is Jiuzhou futures regular? Is it safe to open an account