我想实现以下高可用性设置:
现在,我知道ServiceStack.Redis提供了通过哨兵连接到redis的api:
new RedisSentinel(sentinelHosts, masterName: "mymaster").Start().我还熟悉一个ShardedRedisClientManager,它计算哈希键并返回相应的连接池。
但是,我如何将它们组合在一起,以便我的输入将是一个哨兵列表( init)和请求实际数据的关键?是否有内置的支持在哨兵模式下的切分?
发布于 2019-07-03 16:03:59
我将为未来的谷歌员工回答我自己的问题。我们在ServiceStack中只发现了对分片的部分支持,最后得到了以下代码:
new ConsistentHash<RedisSentinelClientManagerWrapper>(clientManagers);- where RedisSentinelClientManagerWrapper is our own class which holds instance of sentinel client manager and implements GetHashCode()
- clientManagers is a list of all those sentinel manager wrappers (we have only 2 according to requirements).
https://stackoverflow.com/questions/50107173
复制相似问题