当前位置:网站首页>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 .
边栏推荐
- [unreal] key to open the door blueprint notes
- XA Transaction SQL Statements
- Record personal understanding and experience of game console configuration
- int与string、int与QString互转
- [ue5] blueprint making simple mine tutorial
- A model can do two things: image annotation and image reading Q & A. VQA accuracy is close to human level | demo can be played
- 【虚幻】武器插槽:拾取武器
- 2837xd 代碼生成——StateFlow(4)
- 一次聊天勾起的回忆
- 2837xd 代码生成——补充(2)
猜你喜欢

MySQL index

TD conducts functional simulation with Modelsim

Typora installation package sharing

2837xd 代碼生成——補充(1)

Introduction and prevention of penetration test

Off grid control of three-phase inverter - PR control

图像识别-数据标注

Sil/pil test of matlab code generation

2837xd code generation - stateflow (4)

Failed to configure a DataSource: ‘url‘ attribute is not specified and no embedd
随机推荐
Personal experience & blog status
PI control of three-phase grid connected inverter - off grid mode
ZK configuration center -- configuration and use of config Toolkit
Summary of demand R & D process nodes and key outputs
UE4夜间打光笔记
2837xd Code Generation - Supplement (1)
Because of hard work, the fruit goes with fate
Alibaba cloud SLS log service
2837xd 代码生成——StateFlow(4)
【虚幻】武器插槽:拾取武器
TD conducts functional simulation with Modelsim
阿里云ack介绍
Bugkuctf-web24 (problem solving ideas and steps)
Alibaba cloud SMS service
Ckeditor 4.10.1 upload pictures to prompt "incorrect server response" problem solution
[Yu Yue education] University Physics (Electromagnetics) reference materials of Taizhou College of science and technology, Nanjing University of Technology
Bookmark collection management software suspension reading and data migration between knowledge base and browser bookmarks
go语言入门
2837xd代码生成模块学习(4)——idle_task、Simulink Coder
ICLR 2022: how does AI recognize "things I haven't seen"?