Redis:计算Redis集群上的特定类别密钥?(Redis: count specific class of keys on a Redis cluster?)
有没有一种有效的方法来计算Redis集群上的特定类别的密钥?
这里,“特定密钥类”是指用于共同目的的密钥; 例如会话密钥。 他们可以有一个公共密钥名称前缀。 可以有多个类。 从现在开始,我将把键类指定为键。
我想要做的是如下:
- 必须使用Redis群集。
- 密钥必须分配给Redis集群的节点。
- 必须有一种有效的方法来计算Redis群集的所有节点上的密钥数。
- 密钥可以有TTL - 即可以过期。
- Redis集群节点的数量可以在运行时更改,散列槽可以重新分配。
- 客户端使用Node.js实现。
我已阅读文档,但找不到合适的解决方案。
提前致谢。
Is there an efficient method to count specific class of keys on a Redis cluster?
Here, 'specific class of keys' means the keys that are used for a common purpose; for example, session keys. They can have a common key name prefix. There can be multiple classes. From now, I will refer the class of keys as simply the keys.
What I want to do is as follows:
- Redis cluster must be used.
- The keys must be distributed to the nodes of the Redis cluster.
- There must be an efficient way to count the number of the keys on all of the nodes of the Redis cluster.
- The keys can have TTL - that is, can expire.
- The number of the nodes of the Redis cluster can be changed on runtime, and hash slots can be redistributed.
- Clients are implemented using Node.js.
I've read the documentation, but could not find a proper solution.
Thanks in advance.
原文:https://stackoverflow.com/questions/47916482
满意答案
我能够像这样修复你的例子:
bus = QDBusConnection.systemBus() bus.registerObject('/', self) bus.connect( ...
但是,我必须承认我并不完全理解为什么它有效(也就是说,我找不到任何确凿的文件)。 但是,在尝试建立连接之前,您需要注册接收器对象似乎是有道理的。
I was able to fix your example like this:
bus = QDBusConnection.systemBus() bus.registerObject('/', self) bus.connect( ...
However, I have to admit I don't exactly understand why it works (which is to say, I couldn't find any corroborating documentation). It does seem to make sense that you'd need to register the receiver object before attempting to make the connection, though.
相关问答
更多将几个小部件中的相同信号连接到PyQt中的相同功能?(Connect the same signal from several widgets to the same function in PyQt?)
PyQt 5.6:连接到DBus信号挂起(PyQt 5.6: connecting to a DBus signal hangs)
在pyqt中以for循环连接多个信号/槽(Connecting multiples signal/slot in a for loop in pyqt)
连接到示例DBus守护程序的C#程序总是获取'访问被拒绝:DBus.BusObject'(C# program connecting to example DBus daemon always gets 'Access is denied: DBus.BusObject')
如何从命令行发出dbus信号(How to emit dbus signal from command line)
PyQt4:仅处理最后一个信号(PyQt4: Only the last signal is being processed)
如何接收使用dbus作为信号发送的结构?(How to receive a struct which was sent as a signal using dbus?)
带有dbus接口的PyQT5在查询时冻结(PyQT4工作的地方)(PyQT5 with dbus interface freezes on interspection (where PyQT4 works))
PyQt5:根据文档,一个信号而不是两个(PyQt5: one signal comes instead of two as per documentation)
如何使用带有PyQt4的QDBusAbstractAdaptor在DBus上公开方法和属性?(How does one expose methods and properties on DBus using a QDBusAbstractAdaptor with PyQt4?)
相关文章
更多redis 集群环境搭建-redis集群管理
redis 集群使用主从复制架构-redis集群管理
Redis Cookbook
redis新增集群节点-redis集群管理
Redis 哈希(Hash)详解
redis删除集群节点-redis集群管理
redis集群插槽分配-redis集群管理
redis集群出现宕机没法访问-redis集群管理
redis sentinel.conf详解-redis集群管理
最新问答
更多获取MVC 4使用的DisplayMode后缀(Get the DisplayMode Suffix being used by MVC 4)
如何通过引用返回对象?(How is returning an object by reference possible?)
矩阵如何存储在内存中?(How are matrices stored in memory?)
每个请求的Java新会话?(Java New Session For Each Request?)
css:浮动div中重叠的标题h1(css: overlapping headlines h1 in floated divs)
无论图像如何,Caffe预测同一类(Caffe predicts same class regardless of image)
xcode语法颜色编码解释?(xcode syntax color coding explained?)
在Access 2010 Runtime中使用Office 2000校对工具(Use Office 2000 proofing tools in Access 2010 Runtime)
从单独的Web主机将图像传输到服务器上(Getting images onto server from separate web host)
从旧版本复制文件并保留它们(旧/新版本)(Copy a file from old revision and keep both of them (old / new revision))
Copyright ©2023 peixunduo.com All Rights Reserved.粤ICP备14003112号
本站部分内容来源于互联网,仅供学习和参考使用,请莫用于商业用途。如有侵犯你的版权,请联系我们(neng862121861#163.com),本站将尽快处理。谢谢合作!