当前位置:网站首页>Redis cluster messages
Redis cluster messages
2022-06-26 15:00:00 【Hua Weiyun】
Redis Cluster message
redis There are five types of cluster messages .
1. PING news
This message is used to detect whether the node is online . Each node in the cluster randomly selects five nodes from the list and sends PING news
2. MEET news
MEET The message is sent by the client CLUSTER MEET ip port command , The node receiving the command sends a message to ip The host and port Host send MEET news , To join the host to the cluster
3. PONG news
PONG A message is when you receive MEET or PING After the news , Send to sender PONG Message to confirm receipt of the sender's message . When a node becomes a master from a slave , This node can be accessed through PONG The message updates the perception of other nodes .
This is a cluster.h Upper clusterMsgData, This is the body of the message
union clusterMsgData { /* PING, MEET and PONG */ struct { /* Array of N clusterMsgDataGossip structures */ clusterMsgDataGossip gossip[1]; } ping; /* FAIL */ struct { clusterMsgDataFail about; } fail; /* PUBLISH */ struct { clusterMsgDataPublish msg; } publish; /* UPDATE */ struct { clusterMsgDataUpdate nodecfg; } update;};
You can see from the structure that these three messages are generated by clusterMsgDataGossip Composed of
4. Release the news
When the node receives PUBLISH On command , The node broadcasts to the cluster while running the command PUBLISH news , This enables other nodes to run the command .
clusterMsgDataPublish The structure of the body
typedef struct { // Channel name length uint32_t channel_len; // The length of the message uint32_t message_len; /* We can't reclare bulk_data as bulk_data[] since this structure is * nested. The 8 bytes are removed from the count during the message * length computation. */ // The message content unsigned char bulk_data[8];} clusterMsgDataPublish;
5. Fault message
When a master node determines that another master node is offline , The fault message will broadcast the fault message to the cluster , To notify another node that the node is offline .
clusterMsgDataFail Structure
typedef struct { // The name of the failed node char nodename[CLUSTER_NAMELEN];} clusterMsgDataFail;
summary
This is it. redis frequently-used 5 A message , Let's conclude by PING Cancellation message 、PONG news 、MEET news 、 Release messages and fault messages ,PING Messages are used to detect whether nodes are online ,PONG The message is to receive PING News or MEET Feedback from the message , The table name message has been received ,MEET Messages are used to get hosts to join the cluster , Publishing news is used to broadcast , The fault message is published when the node is offline , Indicates that the host has failed .
Well, that's what we're talking about today , Like friends, welcome to give me some praise , Hey
️ 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 . - If there is anything inappropriate, you are welcome to criticize and correct .
边栏推荐
- Halcon C # sets the form font and adaptively displays pictures
- 【soloπ】adb连接单个多个手机
- R语言epiDisplay包的tableStack函数制作统计汇总表格(分组的描述性统计、假设检验等)、不设置by参数计算基础描述性统计信息、指定对于大多数样本负相关的变量进行反序
- Unity 利用Skybox Panoramic着色器制作全景图预览有条缝隙问题解决办法
- nvidia-smi 报错
- 信息学奥赛一本通 1405:质数的和与积 (思维题)
- Extended hooks
- Numpy基本使用
- 使用宝塔面板部署flask环境
- 【雲原生】 ”人人皆可“ 編程的無代碼 iVX 編輯器
猜你喜欢
Unity uses skybox panoramic shader to make panorama preview. There is a gap. Solution
Electron
Electron
Minister of investment of Indonesia: Hon Hai is considering establishing electric bus system and urban Internet of things in its new capital
[solo π] ADB connects multiple mobile phones
Use abp Zero builds a third-party login module (II): server development
MySQL master-slave replication and read-write separation
Detailed explanation of C language programming problem: can any three sides form a triangle, output the area of the triangle and judge its type
赠书 | 《认知控制》:我们的大脑如何完成任务?
Electron
随机推荐
Error when redis is started: could not create server TCP listening socket *: 6379: bind: address already in use - solution
信息学奥赛一本通 1400:统计单词数 (字符串匹配)
聊聊几位大厂清华同学的近况
【 Native cloud】 Éditeur ivx Programmable par tout le monde
Use abp Zero builds a third-party login module (I): Principles
Combat readiness mathematical modeling 31 data interpolation and curve fitting 3
Redis事务与watch指令
Kubernetes的pod调度
What is the ranking of Guosen Securities? Is it safe to open a stock account?
Mark: unity3d cannot select resources in the inspector, that is, project locking
Notes on writing questions in C language -- table tennis competition
Practical website recommendations worth collecting for College Students
The engine "node" is inconsistent with this module
This is the graceful file system mounting method, which is effective through personal testing
打新债注册开户安全吗,有没有什么风险?
'coach, I want to play basketball!'—— AI Learning Series booklet for system students
SAP gui 770 下载
信息学奥赛一本通 1405:质数的和与积 (思维题)
Keil4打开单片机工程一片空白,cpu100%程序卡死的问题解决
一个快速切换一个底层实现的思路分享