Do you want to proceed with the proposed reshard plan (yes/no)? yes
......
Moving slot 5796 from redis02:7003 to 170.101.103.4:7010:
Moving slot 5797 from redis02:7003 to 170.101.103.4:7010:
Moving slot 5798 from redis02:7003 to 170.101.103.4:7010:
[ERR] Calling MIGRATE: ERR Syntax error, try CLIENT (LIST | KILL | GETNAME | SETNAME | PAUSE | REPLY)
Redis 版本 :4.0.1 ruby gem redis 版本:4.0.1
版本bug,官方已确认 https://github.com/antirez/redis/issues/5029
gem list|grep redis
gem uninstall redis
gem install redis -v 3.3.5
错误信息
[WARNING] Node redis01:7010 has slots in importing state (5798).
[WARNING] Node 170.101.103.70:7003 has slots in migrating state (5798).
[WARNING] The following slots are open: 5798
解决办法 分别连入7010和7003节点,执行:
cluster setslot 5798 stable
执行gem list|grep redis
发现redis插件有2个版本为3.0.0和4.0.1,执行gem uninstall redis
卸载4.0.1版本后,执行redis-trib.rb
提示无法连接节点 报错信息
$ redis-trib.rb reshard redis01:7004
[ERR] Sorry, can't connect to node redis01:7004
原因 redis集群设置了密码,但3.x版本的不支持带密码验证的访问(不确定)
解决办法 修改如下文件,修改:password
项为集群密码,这里为passwd1234
。文件位置可能不太一样,通过find命令寻找。
# vi /usr/local/lib/ruby/gems/2.5.0/gems/redis-3.0.0/lib/redis/client.rb
require "redis/errors"
class Redis
class Client
DEFAULTS = {
:scheme => "redis",
:host => "127.0.0.1",
:port => 6379,
:path => nil,
:timeout => 5.0,
:password => "passwd1234",
:db => 0,
}
注:此办法不能避免下面的NOAUTH Authentication required
报错
执行redis-trib.rb reshard
到5798槽的时候报错 报错信息
[ERR] Calling MIGRATE: ERR Target instance replied with error: NOAUTH Authentication required.
原因 节点间存在密码验证,3.x版本密码兼容性不OK
解决办法 临时注释掉所有节点(主节点&从节点)的requirepass
和masterauth
,例如
redis-cli -h redis01 -p 7005 -a passwd1234 -c config set requirepass ""
redis-cli -h redis01 -p 7005 -a passwd1234 -c config set masterauth ""
可以编写脚本执行
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。
原创声明:本文系作者授权腾讯云开发者社区发表,未经许可,不得转载。
如有侵权,请联系 cloudcommunity@tencent.com 删除。