redis-trib.rb是redis官方推出的管理redis集群的工具,集成在redis的源码src目录下,是基于redis提供的集群命令封装成简单、便捷、实用的操作工具。redis-trib.rb是redis作者用ruby完成的。 其中一个rebalance,使用非常多,在扩容节点后需要进行均衡slot的自动均衡,做slot迁移。但由于这个功能在3.0.6的版本中才有,为什么这个版本才有的原因,可能是之前不支持mutil migrate的原因。
如果需要在3.0.6以前的版本,或者redis集群中存在3.0.6以前的版本,那和就无法使用这个工具的rebalance工具,比较遗憾。但不不要紧,这里这这个脚本是可以进行rebalance的,只不过速度没有在3.0.6以及以上版本那么快。
git地址:[https://github.com/beebol/redis-trib.rb](https://github.com/beebol/redis-trib.rb)
3.0.6以前版本使用工具报如下错误:
redis-trib.rb rebalance --threshold 1 --use-empty-masters 127.0.0.1:9001
Performing Cluster Check (using node 127.0.0.1:9001) [OK]
All nodes agree about slots configuration.
Check for open slots...
Check slots coverage... [OK]
All 16384 slots covered.
Rebalancing across 5 nodes.
Total weight = 5
Moving 820 slots from 127.0.0.1:9003 to 127.0.0.1:9005
[ERR] ERR syntax error ···
下载使用后不会报这个问题了。
使用,下载后在可以运行的redis-trib.rb机器上直接可执行。
git上的版本,只是在move_slot处将mutil migrate改成migrate方式 ,因为3.0.6才支持mutil migrate,如果是以下版本就无法使用官方的版本,可以用这个版本。但如果redis版本都是3.0.6以上,那建议还是用官方的版本。
文章最后更新时间:
2017年07月30日 05:54:57
Фильмы, сериалы и тв онлайн в HD качестве - онлайн kinoteatrzarya Новые фильмы Дюна Шерлок Холмс 3 Человек-паук 3 Дьявол в белом городе Доктор Стрэндж 2 и мультивселенная безумия
Hi there! I understand this is somewhat off-topic but I needed to ask. Does running a well-established website like yours take a large amount of work? I am completely new to blogging but I do write in my journal daily. I'd like to start a blog so I can share my experience and feelings online. Please let me know if you have any recommendations or tips for brand new aspiring blog owners. Appreciate it!
Asking questions are really good thing if you are not understanding something completely, but this piece of writing gives nice understanding yet.
It is appropriate time to make some plans for the future and it is time to be happy. I have read this post and if I could I wish to suggest you some interesting things or suggestions. Maybe you can write next articles referring to this article. I want to read even more things about it!
Excellent post. I was checking continuously this weblog and I am impressed! Very useful information specially the remaining phase : ) I deal with such info much. I was looking for this particular information for a very lengthy time. Thanks and best of luck.
It's perfect time to make some plans for the future and it is time to be happy. I've read this post and if I could I wish to suggest you few interesting things or tips. Maybe you could write next articles referring to this article. I desire to read even more things about it!
Your means of telling everything in this post is really pleasant, every one can easily be aware of it, Thanks a lot.
This paragraph is really a fastidious one it assists new the web users, who are wishing in favor of blogging.