V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
yangxiaoluck
V2EX  ›  程序员

redis 集群模式,如何监听每个节点的过期键通知

  •  
  •   yangxiaoluck · Dec 18, 2017 · 5223 views
    This topic created in 3055 days ago, the information mentioned may be changed or developed.

    rt 目标: 2 台 master+2 台 slave 组的 redis 集群,要用一个服务去监听 2 个 master 节点的键过期通知。 现象: 连 A 节点的时候,无法监听到 B 的通知,连 B 的时候无法监听 A 的通知。

    5 replies    2017-12-19 10:20:33 +08:00
    fumichael
        1
    fumichael  
       Dec 18, 2017
    Redis 集群好像是要 3 个节点起步,也就是 3×2=6


    来自: https://redis.io/topics/cluster-tutorial
    yangxiaoluck
        2
    yangxiaoluck  
    OP
       Dec 18, 2017
    @fumichael 嗯 谢谢 node 数量不是重点,现在重点是 有没有什么比较好能监听到每个节点键失效的解决方案
    soli
        3
    soli  
       Dec 18, 2017
    连接所有 master 呢?
    crazyneo
        4
    crazyneo  
       Dec 18, 2017
    keyspace notification,这个只和订阅频道有关系,和连接节点没关系。但这种方式目前不保证所有的通知都一定能被接收。
    yangxiaoluck
        5
    yangxiaoluck  
    OP
       Dec 19, 2017
    @crazyneo 分布式集群监听一个 channel 应该能一定成都上保证
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   1184 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 34ms · UTC 17:38 · PVG 01:38 · LAX 10:38 · JFK 13:38
    ♥ Do have faith in what you're doing.