问题描述
重新分片redis集群时,遇到问题.
redis集群信息和问题详情如下:
When I reshard redis cluster, I meet a problem.
The redis cluster information and problem detail show as below:
obasa04:/usr/redis-4.0.2/src # redis-trib.rb info 10.239.65.82:10000
10.239.65.82:10000 (90c088ff...) -> 4 keys | 6974 slots | 1 slaves.
10.239.65.82:10004@20004 (a219daf5...) -> 7 keys | 5462 slots | 1 slaves.
10.239.65.82:10002@20002 (951e4654...) -> 3 keys | 3948 slots | 1 slaves.
[OK] 14 keys in 3 masters.
0.00 keys per slot on average.
obasa04:/usr/redis-4.0.2/src # redis-trib.rb reshard 10.239.65.82:10000
>>> Performing Cluster Check (using node 10.239.65.82:10000)
M: 90c088ff8fca8e5cbf4e901bbff571b0427a306d 10.239.65.82:10000
slots:0-5460,10923-12435 (6974 slots) master
1 additional replica(s)
M: a219daf5ebf86f2bb4cd7e4dab9926b9570d0654 10.239.65.82:10004@20004
slots:5461-10922 (5462 slots) master
1 additional replica(s)
S: f60d0c4059aae4d46882952b701ed2ab3161bbd5 10.239.65.82:10001@20001
slots: (0 slots) slave
replicates a219daf5ebf86f2bb4cd7e4dab9926b9570d0654
M: 951e46545733d2ab4159b95f9d69ad1bdf85f0b3 10.239.65.82:10002@20002
slots:12436-16383 (3948 slots) master
1 additional replica(s)
S: bb2221fd2599f541a51cddbd41a27954d842c1a3 10.239.65.82:10005@20005
slots: (0 slots) slave
replicates 951e46545733d2ab4159b95f9d69ad1bdf85f0b3
S: d7c53081deb5e61d180124db1f9541a373c6d32a 10.239.65.82:10003@20003
slots: (0 slots) slave
replicates 90c088ff8fca8e5cbf4e901bbff571b0427a306d
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
>>> Check slots coverage...
[OK] All 16384 slots covered.
How many slots do you want to move (from 1 to 16384)? 10
What is the receiving node ID? 90c088ff8fca8e5cbf4e901bbff571b0427a306d
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
Ready to move 10 slots.
Source nodes:
M: a219daf5ebf86f2bb4cd7e4dab9926b9570d0654 10.239.65.82:10004@20004
slots:5461-10922 (5462 slots) master
1 additional replica(s)
M: 951e46545733d2ab4159b95f9d69ad1bdf85f0b3 10.239.65.82:10002@20002
slots:12436-16383 (3948 slots) master
1 additional replica(s)
Destination node:
M: 90c088ff8fca8e5cbf4e901bbff571b0427a306d 10.239.65.82:10000
slots:0-5460,10923-12435 (6974 slots) master
1 additional replica(s)
Resharding plan:
Moving slot 5461 from a219daf5ebf86f2bb4cd7e4dab9926b9570d0654
Moving slot 5462 from a219daf5ebf86f2bb4cd7e4dab9926b9570d0654
Moving slot 5463 from a219daf5ebf86f2bb4cd7e4dab9926b9570d0654
Moving slot 5464 from a219daf5ebf86f2bb4cd7e4dab9926b9570d0654
Moving slot 5465 from a219daf5ebf86f2bb4cd7e4dab9926b9570d0654
Moving slot 5466 from a219daf5ebf86f2bb4cd7e4dab9926b9570d0654
Moving slot 12436 from 951e46545733d2ab4159b95f9d69ad1bdf85f0b3
Moving slot 12437 from 951e46545733d2ab4159b95f9d69ad1bdf85f0b3
Moving slot 12438 from 951e46545733d2ab4159b95f9d69ad1bdf85f0b3
Moving slot 12439 from 951e46545733d2ab4159b95f9d69ad1bdf85f0b3
Do you want to proceed with the proposed reshard plan (yes/no)? yes
Moving slot 5461 from 10.239.65.82:10004@20004 to 10.239.65.82:10000:
Moving slot 5462 from 10.239.65.82:10004@20004 to 10.239.65.82:10000:
Moving slot 5463 from 10.239.65.82:10004@20004 to 10.239.65.82:10000:
Moving slot 5464 from 10.239.65.82:10004@20004 to 10.239.65.82:10000:
Moving slot 5465 from 10.239.65.82:10004@20004 to 10.239.65.82:10000:
Moving slot 5466 from 10.239.65.82:10004@20004 to 10.239.65.82:10000:
Moving slot 12436 from 10.239.65.82:10002@20002 to 10.239.65.82:10000:
[ERR] Calling MIGRATE: ERR Syntax error, try CLIENT (LIST | KILL | GETNAME | SETNAME | PAUSE | REPLY)
这里的图像可能易于阅读
and here is the image maybe easy to read
我想知道为什么其他空插槽可以从 10.239.65.82:10004@20004 迁移到 10.239.65.82:10000.但是插槽 12439 不是空的迁移错误?
I wonder why other slots which are empty can migrate from from 10.239.65.82:10004@20004 to 10.239.65.82:10000. However slot 12439 which is not empty migrate with error?
之后,我检查集群状态并显示:
after that , I check the cluster status and show:
obasa04:/usr/redis-4.0.2/src # redis-trib.rb check 10.239.65.82:10000
>>> Performing Cluster Check (using node 10.239.65.82:10000)
M: 90c088ff8fca8e5cbf4e901bbff571b0427a306d 10.239.65.82:10000
slots:0-5466,10923-12435 (6980 slots) master
1 additional replica(s)
M: a219daf5ebf86f2bb4cd7e4dab9926b9570d0654 10.239.65.82:10004@20004
slots:5467-10922 (5456 slots) master
1 additional replica(s)
S: f60d0c4059aae4d46882952b701ed2ab3161bbd5 10.239.65.82:10001@20001
slots: (0 slots) slave
replicates a219daf5ebf86f2bb4cd7e4dab9926b9570d0654
M: 951e46545733d2ab4159b95f9d69ad1bdf85f0b3 10.239.65.82:10002@20002
slots:12436-16383 (3948 slots) master
1 additional replica(s)
S: bb2221fd2599f541a51cddbd41a27954d842c1a3 10.239.65.82:10005@20005
slots: (0 slots) slave
replicates 951e46545733d2ab4159b95f9d69ad1bdf85f0b3
S: d7c53081deb5e61d180124db1f9541a373c6d32a 10.239.65.82:10003@20003
slots: (0 slots) slave
replicates 90c088ff8fca8e5cbf4e901bbff571b0427a306d
[OK] All nodes agree about slots configuration.
>>> Check for open slots...
[WARNING] Node 10.239.65.82:10000 has slots in importing state (12436).
[WARNING] Node 10.239.65.82:10002@20002 has slots in migrating state (12436).
[WARNING] The following slots are open: 12436
>>> Check slots coverage...
[OK] All 16384 slots covered.
有没有其他方法可以解决这个问题?
我的 redis 是 4.0.2,ruby 是 2.4.2p198
非常感谢你!!
Is there any other way to solve this problem ?
my redis is 4.0.2, ruby is 2.4.2p198
Thank you very much!!
推荐答案
尝试:
redis.rb v4.0.1 downgrade to v3.3.3
https://github.com/antirez/redis/issues/4272
这篇关于redis cluster reshard [ERR] 调用迁移:ERR 语法错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!