gpt4 book ai didi

redis - 主从和发布订阅连接

转载 作者:IT王子 更新时间:2023-10-29 06:00:20 26 4
gpt4 key购买 nike

假设我有一个 Redis 的主从部署(1 个主从)和一个将管理发布-订阅的客户端(webapp)。

  • 我可以向从服务器发布消息吗?它们会被主服务器“看到”吗?
  • 或者我应该只使用 Master 进行发布,使用 Slave 进行订阅命令?

我一直在四处寻找,但找不到答案。有人知道吗?

最佳答案

编辑:正如@jameshfisher 所指出的,下面的链接是关于Redis Cluster 的。 @lionello 的评论似乎是正确的答案:

Publishing to a slave will not propagate to the master, only the other way around.

答案在 cluster-spec 文档:

Publish/Subscribe

In a Redis Cluster clients can subscribe to every node, and can also publish to every other node. The cluster will make sure that published messages are forwarded as needed.The current implementation will simply broadcast each published message to all other nodes, but at some point this will be optimized either using Bloom filters or other algorithms.

关于redis - 主从和发布订阅连接,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15258209/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com