当前位置:网站首页>Cluster addslots establish a cluster
Cluster addslots establish a cluster
2022-06-26 15:00:00 【Hua Weiyun】
cluster addslots Build clusters
redis There are 16384 Slot bits , Use CLUSTER MEET The command did not allocate time slot bits when building the cluster . You can send CLUSTER ADDSLOTS The command assigns the time slot bit to the current node cluster node slots Property is used to record which slot the node is responsible for .
data structure
slots It's a binary digit group , If the binary value of the array index is 1, Indicates that the current node is responsible for this slot , Otherwise, you are not responsible for the slot . numslots Attribute the number of slots that the storage node is responsible for , These two attributes record the slot location of the current node , The current node sends messages to other nodes in the cluster . received slots The node of the array saves the array information in the corresponding node clusterNode In structure .
Besides ,clusterState Structural slots The array also holds the allocation of slots . slots Array has 16384 Elements , The pointer to the element is null , Indicates that no slot bits are allocated , The pointer to a cluster node structure indicates the node assigned to the slot .
Why is the slot allocation information saved in the cluster node slots Array , It is also saved in the cluster state slots Array ?
Since the cluster node records the allocation of slots , But there is no record of which node the slot is assigned to , So please traverse the state of the cluster nodes Cluster node structure of dictionary , see slots Array
Command to use
CLUSTER ADDSLOTS Command to complete the command to assign the slot to the node , Change the status of the cluster slots The index of the slot in the array points to the current node clusterNode structure , And specify the name of the cluster node slots Array
redis It is through CLUSTER ADDSLOTS Command to complete slot allocation
> CLUSTER ADDSLOTS 1 2 3OKThis is through CLUSTER ADDSLOTS Command to allocate slots , take 1 2 3 Three slots are allocated to the server that receives this command .
When the slot is divided and then allocated, an error will be reported , Like the command above , If the execution is successful, another execution will result in an error .
summary
Okay , today cluster addslots The command is written and analyzed here , If something is wrong, please give me more advice .
️ Thank you for your
If you think this is helpful for you :
- Welcome to follow me ️, give the thumbs-up , Comment on , forward
- Focus on
Panpan small class, Push good articles for you regularly , There are also group chat and irregular lottery activities , You can say what you want , Communicate with the great gods , Learning together .
边栏推荐
- R language GLM function logistic regression model, using epidisplay package logistic The display function obtains the summary statistical information of the model (initial and adjusted odds ratio and
- The intersect function in the dplyr package of R language obtains the data lines that exist in both dataframes and the data lines that cross the two dataframes
- R语言dplyr包intersect函数获取在两个dataframe中都存在的数据行、获取两个dataframe交叉的数据行
- Login authentication service
- Use abp Zero builds a third-party login module (II): server development
- Keil4打开单片机工程一片空白,cpu100%程序卡死的问题解决
- The R language cartools package divides data, the scale function scales data, and the KNN function of the class package constructs a k-nearest neighbor classifier
- 备战数学建模31-数据插值与曲线拟合3
- redis集群的重新分片与ASK命令
- 人的顶级能量从哪里获取?
猜你喜欢

关于 selenium.common.exceptions.WebDriverException: Message: An unknown server-side error 解决方案(已解决)

人力资源导出数据 excel VBA

feil_uVission4左侧工目录消失

程序分析与优化 - 8 寄存器分配

Attention meets geometry: geometry guided spatiotemporal attention consistency self supervised monocular depth estimation

聊聊 RPA 方向的规划:简单有价值的事情长期坚持做

Where do people get their top energy?

Halcon C# 设置窗体字体,自适应显示图片

Complimentary Book Cognitive Control: how does our brain accomplish tasks?

Unity uses skybox panoramic shader to make panorama preview. There is a gap. Solution
随机推荐
R语言dplyr包bind_rows函数把两个dataframe数据的行纵向(竖直)合并起来、最终行数为原来两个dataframe行数的加和(Combine Data Frames)
Login authentication service
信息学奥赛一本通 1400:统计单词数 (字符串匹配)
【云原生】 ”人人皆可“ 编程的无代码 iVX 编辑器
Mathematical modeling of war preparation 30 regression analysis 2
Attention meets Geometry:几何引导的时空注意一致性自监督单目深度估计
Document 1
赠书 | 《认知控制》:我们的大脑如何完成任务?
券商经理给的开户二维码安全吗?找谁可以开户啊?
Is it safe to open an account by digging money? Is there any risk?
Halcon C # sets the form font and adaptively displays pictures
R语言使用epiDisplay包的aggregate函数将数值变量基于因子变量拆分为不同的子集,计算每个子集的汇总统计信息、使用aggregate.data.frame函数计算分组汇总统计信息
TCP拥塞控制详解 | 1. 概述
NAACL2022:(代码实践)好的视觉引导促进更好的特征提取,多模态命名实体识别(附源代码下载)...
Detailed explanation of C language programming problem: can any three sides form a triangle, output the area of the triangle and judge its type
Optimizing for vectorization
Complimentary Book Cognitive Control: how does our brain accomplish tasks?
Stream常用操作以及原理探索
One copy ten, CVPR oral was accused of plagiarizing a lot, and it was exposed on the last day of the conference!
【雲原生】 ”人人皆可“ 編程的無代碼 iVX 編輯器