Redis Cluster 的安装和配置(2)
$ ./redis-trib.rb reshard 127.0.0.1:7000... ...
# 需要迁移的 slots 数目
How many slots do you want to move (from 1 to 16384)? 1000
# 接收这 1000 个 slots 的节点,这里必须填写为 NodeID
What is the receiving node ID? 123ed65d59ff22370f2f09546f410d31207789f6
# 这里需要设置从哪些 源节点 中选择 slots,这里 all 表示从所有节点中选择
Please enter all the source node IDs.
Type 'all' to use all the nodes as source nodes for the hash slots.
Type 'done' once you entered all the source nodes IDs.
Source node #1: all
# 下面列出了 Source nodes 以及 Destination node(即 7000 节点)
Ready to move 1000 slots.
Source nodes:
M: 82578e8ec9747e46cbb4b8cc2484c71b9b2c91f4 127.0.0.1:7001
slots:5962-10922 (4961 slots) master
1 additional replica(s)
M: f5bdda1518cd3826100a30f5953ed82a5861ed48 127.0.0.1:7002
slots:11422-16383 (4962 slots) master
1 additional replica(s)
Destination node:
M: 123ed65d59ff22370f2f09546f410d31207789f6 127.0.0.1:7000
slots:0-5961,10923-11421 (6461 slots) master
1 additional replica(s)
# 下面为 redis-trib 列出的 reshard 的 slot 规划:
Resharding plan:
Moving slot 11422 from f5bdda1518cd3826100a30f5953ed82a5861ed48
Moving slot 11423 from f5bdda1518cd3826100a30f5953ed82a5861ed48
Moving slot 11424 from f5bdda1518cd3826100a30f5953ed82a5861ed48
# 如果接收 redis-trib 的 slot reshard plan,则录入 yes
Do you want to proceed with the proposed reshard plan (yes/no) yes
# 开始执行 resharding
Moving slot 11422 from 127.0.0.1:7002 to 127.0.0.1:7000:
Moving slot 11423 from 127.0.0.1:7002 to 127.0.0.1:7000:
Moving slot 11424 from 127.0.0.1:7002 to 127.0.0.1:7000:
# 下面我们校验一下,确认 resharding OK
$ ./redis-trib.rb check 127.0.0.1:7000
>>> Performing Cluster Check (using node 127.0.0.1:7000)
M: 123ed65d59ff22370f2f09546f410d31207789f6 127.0.0.1:7000
slots:0-6460,10923-11922 (7461 slots) master
1 additional replica(s)
页:
[1]