redis cluster reshard [ERR]调用MIGRATE:ERR语法错误

时间:2017-12-12 13:40:27

标签: redis

当我重新使用redis群集时,我遇到了问题 redis集群信息和问题详细信息如下所示:

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) 

这里的图像可能很容易阅读 errorImg1 errorImg2

我想知道为什么其他空的插槽可以从10.239.65.82:10004@20004迁移到10.239.65.82:10000。但是,非空的插槽12439是否有错误迁移?

之后,我检查群集状态并显示:

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
非常感谢你!!

1 个答案:

答案 0 :(得分:2)

尝试:

redis.rb v4.0.1 downgrade to v3.3.3

https://github.com/antirez/redis/issues/4272