当前位置:网站首页>Project practice, redis cluster technology learning (IX)
Project practice, redis cluster technology learning (IX)
2022-07-02 10:05:00 【User 1289394】
3) Add slave node
At the beginning of capacity expansion, we put 6385、6386 Nodes join the cluster , node 6385 Some slots and data are migrated as master nodes , However, compared with other master nodes, there is no slave node at present , Therefore, the node does not have fault switching
Ability to move .
At this time, you need to set the node 6386 As 6385 The slave node , So as to ensure the high availability of the whole cluster . Use cluster replicate{masterNodeId} The command adds the corresponding slave node to the master node , Note that in cluster mode slaveof Add slave node operation is no longer supported . As shown below :
127.0.0.1:6386>cluster replicate
1a205dd8b2819a00dd1e8b6be40a8e2abe77b756
The slave node initiates full replication to the master node , You also need to update the cluster related of the local node
state , Look at the node 6386 The status confirmation has changed to 6385 The slave node of the node
127.0.0.1:6386>cluster nodes
475528b1bcf8e74d227104a6cf1bf70f00c24aae 127.0.0.1:6386 myself,slave 1a205dd8b2
819a00dd1e8b6be40a8e2abe77b756 0 0 8 connected
1a205dd8b2819a00dd1e8b6be40a8e2abe77b756 127.0.0.1:6385 master - 0
1469779083513 9
connected 0-1365 4096 5462-6826 10923-12287
...
This completes the expansion of the entire cluster , The cluster relationship structure is shown in the figure .
10.4.3 Shrink cluster
Process description :
1) First, we need to determine whether the offline node has a responsible slot , If it is , Need to move the slot to another section
spot , Ensure the integrity of the whole cluster slot node mapping after the node is offline .
2) When the downline node is no longer responsible for the slot or is itself a slave node , You can notify other nodes in the cluster to forget the offline nodes , When all nodes forget the node, they can shut down normally .
1. Offline migration slot
Offline nodes need to migrate their own slots to other nodes , The principle is the same as that of the previous node expansion migration slot
The process is consistent . For example, let's take 6381 and 6384 Node offline , Node information is as follows :
127.0.0.1:6381> cluster nodes
40b8d09d44294d2e23c7c768efc8fcd153446746 127.0.0.1:6381 myself,master - 0 0 2
connected
12288-16383
4fa7eac4080f0b667ffeab9b87841da49b84a6e4 127.0.0.1:6384 slave
40b8d09d44294d2e2
3c7c768efc8fcd153446746 0 1469894180780 5 connected
...
6381 It's the master node , Responsible slot (12288-16383),6384 It's its slave node , Pictured 10-26 Shown . Offline 6381 You need to migrate the responsible slot to other nodes before .
Shrinkage is the opposite of expansion and migration ,6381 Becomes the source node , Other master nodes become target nodes , The source node needs to take responsibility of 4096 The slots migrate evenly to the other master nodes . I'm going to use it directly here redis-trib.rb reshard Command to complete the slot migration . Because of every execution reshard Command can only have one target node , So we need to do 3 Time reshard command , Migrate separately 1365、1365、1366 Slot .
边栏推荐
- C language strawberry
- 逆变器simulink模型——处理器在环测试(PIL)
- 2837xd 代码生成——补充(2)
- kinect dk 获取CV::Mat格式的彩色RGB图像(openpose中使用)
- 2837xd code generation module learning (4) -- idle_ task、Simulink Coder
- [Yu Yue education] University Physics (Electromagnetics) reference materials of Taizhou College of science and technology, Nanjing University of Technology
- QT信号槽总结-connect函数错误用法
- Data insertion in C language
- Read Day5 30 minutes before going to bed every day_ All key values in the map, how to obtain all value values
- Alibaba cloud Prometheus monitoring service
猜你喜欢

vs+qt 设置应用程序图标
![[illusory] weapon slot: pick up weapons](/img/a7/1e395fc9cdfd0359e7ae4d2313290d.png)
[illusory] weapon slot: pick up weapons

2837xd代码生成模块学习(3)——IIC、eCAN、SCI、Watchdog、eCAP模块

Required request body is missing: (cross domain problem)

2837xd code generation - stateflow (2)

Read Day6 30 minutes before going to bed every day_ Day6_ Date_ Calendar_ LocalDate_ TimeStamp_ LocalTime

滲透測試的介紹和防範

2837xd code generation module learning (1) -- GPIO module

2837xd code generation module learning (3) -- IIC, ECAN, SCI, watchdog, ECAP modules

YOLO物体识别,生成数据用到的工具
随机推荐
阿里云Prometheus监控服务
2837xd code generation - Supplement (1)
MySQL transaction
Ue5 - AI pursuit (blueprint, behavior tree)
【虚幻】过场动画笔记
Tee command usage example
Junit4运行mvn test 测试套件升级方案
阿里云SLS日志服务
Sil/pil test of matlab code generation
Mixed development of uni app -- Taking wechat applet as an example
Mysql索引
This monitoring system makes workers tremble: turnover intention and fishing can be monitored. After the dispute, the product page has 404
2837xd 代码生成——补充(3)
Image recognition - Data Cleaning
[unreal] key to open the door blueprint notes
Alibaba / popular JSON parsing open source project fastjson2
Record personal understanding and experience of game console configuration
Summary of demand R & D process nodes and key outputs
2837xd 代码生成——StateFlow(4)
The road is blocked and long, and the line is coming