记一次redis cluster delete node失败

1、6611 的 slot 5731 move失败。 redis-cluster在reshard时失败,提示信息如下:
All nodes agree about slots configuration.

Check for open slots...
Node 172.28.192.84:6430 has slots in importing state (5731).

Node 172.28.192.98:6611 has slots in migrating state (5731).
The following slots are open: 5731
Check slots coverage...
All 16384 slots covered.
Please fix your cluster problems before resharding

slot 5731由于reshard失败,在6430上显示正在import,6611上显示正在migrate。
redis cluster在reshard、rebalance等操作时会执行check_cluster方法检查集群是否健康,只有健康的集群才能进行迁移。
此时无法再继续reshard,需要先fix修复集群,通过下面命令:
redis-trib.rb fix 172.28.192.84:6424
修复完成后,再继续执行reshard即可。
那为何会出现slot migrate失败,查看172.28.192.98:6611 节点的redis.log信息,有如下报错
Moving slot 5731 from 172.28.192.98:6611 to 172.28.192.84:6430:
[ERR] IOERR error or timeout reading to target instance

Performing Cluster Check (using node 172.28.192.84:6430)

迁移过程中遇到超时错误“[ERR] Calling MIGRATE: IOERR error or timeout reading to target instance”,导致只完成部分,可能会造成数据丢失。
如果迁移的slots数量多,应当设置redis-trib.rb的超时参数--timeout值大一点,该参数默认是60s。(变更脚本中未设置,使用的默认值)

2、已经执行过del_node下线的节点,在clusternodes中还显示handshake或者fail,分析是节点移除异常。需要手动执行 forget {downnodeid} 移除cluster nodes中的信息。

3、应用无法再造数据,我这边正在跟开发沟通,确定下次再缩容前,应用数据已落地,或应用可接受数据丢失。

posted on 2021-01-27 11:50  ExplorerMan  阅读(437)  评论(0编辑  收藏  举报

导航