eleme / ruskit Goto Github PK
View Code? Open in Web Editor NEWRedis cluster administration toolkit
License: MIT License
Redis cluster administration toolkit
License: MIT License
[root@localhost ruskit]# ruskit create 127.0.0.1:{6379,6380,6381,6382,6383,6384}
Cluster can not be created: cluster not enabled
现在与redis连接的超时时间都是 1 秒, 之前删除节点的时候可能因为节点数据较多, flushall完成需要几秒, 所以需要给可能耗时较长的命令加个timeout选项.
由于cluster nodes
只会返回当前节点的迁移信息, 而之前又把获取节点信息由从所有节点获取改成只由一个节点获取, 所以现在fix slots是有问题的.
由于对节点做更改操作后, 可能cluster nodes
没有立刻反应修改的东西(如之前发现的加了节点后, cluster nodes里面有一瞬间还没改), 导致现在的一致性检查(cluster.wait)可能存在这样的bug:
cluster nodes
没有更改, 跟之前一样.cluster nodes
开始反应有更改了, 这样后续的consistent操作就会不通过.现在检查集群状态一致性时, 只检查名字和槽位, 而且只检查了是否缺槽位, 没有检查槽位所属是否一致.
此外, 希望可以查出具体哪一部分不一致, 方便debug集群.
2.9的python redis不支持cluster命令
现在均分槽位的算法(cluster.py中的slot_balance)在多次执行后会把槽位分得很散, 导致cluster nodes
和cluster slots
返回的数据非常大, 因此需要优化均分槽位的算法.
要求:
1 整个集群均分时尽可能少迁移槽位
2 不能迁移包含大量数据的槽位
3 整个集群均分后, 槽位尽可能连续 (集群中被切碎的槽位区间尽可能少)
前几天在 FLUSHALL
的时候去尝试连接发现挂了, 因为代码会去 PING
, 那个数据库很大, FLUSHALL
要一点时间的. 然后就发现... 为啥仓库里最新的代码没有 PING
!!! 一看发现 pypi 上的是 0.0.7, github 都 0.0.22 了... 😿 啥时候发布个更新啊... 感恩各位爸爸...
[root@sh-redis-01 env]# ruskit -h
Traceback (most recent call last):
File "/www/env/python27/bin/ruskit", line 5, in
from pkg_resources import load_entry_point
File "/www/env/python27/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 2671, in
working_set.require(requires)
File "/www/env/python27/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 654, in require
needed = self.resolve(parse_requirements(requirements))
File "/www/env/python27/lib/python2.7/site-packages/distribute-0.6.14-py2.7.egg/pkg_resources.py", line 552, in resolve
raise DistributionNotFound(req)
pkg_resources.DistributionNotFound: redis>=2.10.5
[root@sh-redis-01 env]# pip list
bson (0.4.6)
distribute (0.6.14)
elasticsearch (2.4.0)
funcsigs (1.0.2)
hiredis (0.2.0)
mock (2.0.0)
MySQL-python (1.2.5)
mysql-replication (0.11)
pbr (1.10.0)
pip (7.1.2)
pymongo (3.4.0)
PyMySQL (0.7.10)
pytz (2016.10)
redis (2.10.5)
requests (2.11.1)
ruskit (0.0.23)
setuptools (0.6rc11)
six (1.10.0)
urllib3 (1.17)
现在addslave命令会一次性加入所有从节点, 然后等待集群一致. 这在添加大量节点的时候会导致大量主从全同步.
因此需要减慢添加节点的速度, 最好能够等待一批节点完成同步数据, 再加入另一批从节点.
加个检查命令, 可以查
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.