当前位置:网站首页>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语言dplyr包bind_rows函数把两个dataframe数据的行纵向(竖直)合并起来、最终行数为原来两个dataframe行数的加和(Combine Data Frames)
- 程序分析与优化 - 8 寄存器分配
- Transformers datacollatorwithpadding class
- Kubernetes的pod
- Redis事务与watch指令
- Login authentication service
- kubernetes的Controller之deployment
- 印尼投资部长:鸿海考虑在其新首都建立电动公交系统、城市物联网
- The annual salary of 500000 is one line, and the annual salary of 1million is another line
猜你喜欢

Electron

C语言刷题随记 —— 乒乓球比赛

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

Naacl2022: (code practice) good visual guidance promotes better feature extraction, multimodal named entity recognition (with source code download)
杜老师说网站更新图解

TS common data types summary

Bank of Beijing x Huawei: network intelligent operation and maintenance tamps the base of digital transformation service

TS常用数据类型总结

Electron

Document 1
随机推荐
Attention meets Geometry:几何引导的时空注意一致性自监督单目深度估计
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
Numpy basic use
Login authentication service
Solution to the upper limit of TeamViewer display devices
杜老师说网站更新图解
程序分析与优化 - 8 寄存器分配
Unity 利用Skybox Panoramic着色器制作全景图预览有条缝隙问题解决办法
[solo π] ADB connects multiple mobile phones
人的顶级能量从哪里获取?
R language uses GLM function to build Poisson logarithm linear regression model, processes three-dimensional contingency table data to build saturation model, uses step function to realize stepwise re
Mark一下 Unity3d在Inspector中选中不了资源即Project锁定问题
使用 Abp.Zero 搭建第三方登录模块(一):原理篇
Use abp Zero builds a third-party login module (I): Principles
Use abp Zero builds a third-party login module (II): server development
Common operation and Principle Exploration of stream
这才是优美的文件系统挂载方式,亲测有效
Keil4打开单片机工程一片空白,cpu100%程序卡死的问题解决
【云原生】 ”人人皆可“ 编程的无代码 iVX 编辑器
What is the ranking of Guosen Securities? Is it safe to open a stock account?