首页 \ 问答 \ Redis:计算Redis集群上的特定类别密钥?(Redis: count specific class of keys on a Redis cluster?)

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
更新时间:2024-04-11 14:04

最满意答案

我能够像这样修复你的例子:

    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.

相关问答

更多

相关文章

更多

最新问答

更多
  • 如何检索Ember.js模型的所有属性(How to retrieve all properties of an Ember.js model)
  • maven中snapshot快照库和release发布库的区别和作用
  • arraylist中的搜索元素(Search element in arraylist)
  • 从mysli_fetch_array中获取选定的值并输出(Get selected value from mysli_fetch_array and output)
  • Windows Phone上的可用共享扩展(Available Share Extensions on Windows Phone)
  • 如何在命令提示符下将日期设置为文件名(How to set file name as date in command prompt)
  • 如何在Laravel 5.2中使用paginate与关系?(How to use paginate with relationships in Laravel 5.2?)
  • 从iframe访问父页面的id元素(accessing id element of parent page from iframe)
  • linux的常用命令干什么用的
  • Feign Client + Eureka POST请求正文(Feign Client + Eureka POST request body)
  • 怎么删除禁用RHEL/CentOS 7上不需要的服务
  • 为什么Gradle运行测试两次?(Why does Gradle run tests twice?)
  • 由于有四个新控制器,Auth刀片是否有任何变化?(Are there any changes in Auth blades due to four new controllers?)
  • 如何交换返回集中的行?(How to swap rows in a return set?)
  • 在android中的活动之间切换?(Switching between activities in android?)
  • Perforce:如何从Depot到Workspace丢失文件?(Perforce: how to get missing file from Depot to Workspace?)
  • Webform页面避免运行服务器(Webform page avoiding runat server)
  • 在ios 7中的UITableView部分周围绘制边界线(draw borderline around UITableView section in ios 7)
  • 内存布局破解(memory layout hack)
  • 使用Boost.Spirit Qi和Lex时的空白队长(Whitespace skipper when using Boost.Spirit Qi and Lex)
  • 我们可以有一个调度程序,你可以异步添加东西,但会同步按顺序执行吗?(Can we have a dispatcher that you can add things todo asynchronously but will be executed in that order synchronously?)
  • “FROM a,b”和“FROM a FULL OUTER JOIN b”之间有什么区别?(What is the difference between “FROM a, b” and “FROM a FULL OUTER JOIN b”?)
  • Java中的不可变类(Immutable class in Java)
  • bat批处理文件结果导出到txt
  • WordPress发布查询(WordPress post query)
  • 如何在关系数据库中存储与IPv6兼容的地址(How to store IPv6-compatible address in a relational database)
  • 是否可以检查对象值的条件并返回密钥?(Is it possible to check the condition of a value of an object and JUST return the key?)
  • 德州新起点计算机培训学校主要课程有什么?
  • GEP分段错误LLVM C ++ API(GEP segmentation fault LLVM C++ API)
  • “latin1_german1_ci”整理来自哪里?(Where is “latin1_german1_ci” collation coming from?)