Azure Redis 缓存 - 如何正确处理复制实例
Azure Redis Cache - how to correctly work against a replicated instance
根据 Azure Redis 缓存团队成员的 回答,Azure Redis 缓存公开了一个端点。该端点会自动路由到主节点或从节点(我假设是在故障转移时)。该答案还指出:
Azure... requires checks on the client side to ensure that the node is
indeed Master or Slave
所以客户看到一个端点并且有时必须检查他们正在与哪个实例交谈 - 这引发了一些问题:
Redis 客户端什么时候应该关心它是与主节点还是从节点对话?只是为了防止故障转移时不一致,还是这里还有其他问题?
客户端应该如何(以及何时)检查它是连接到主实例还是从实例?是 运行 info replication
?
来自docs:
When the master node is rebooted, Azure Redis Cache fails over to the replica node and promotes it to master. During this failover, there may be a short interval in which connections may fail to the cache.
我的理解是你永远不会连接到奴隶,因为它永远不会暴露给你。如果 master 出去了,slave 会提升为 master,这就是你重新连接的。
根据 Azure Redis 缓存团队成员的
Azure... requires checks on the client side to ensure that the node is indeed Master or Slave
所以客户看到一个端点并且有时必须检查他们正在与哪个实例交谈 - 这引发了一些问题:
Redis 客户端什么时候应该关心它是与主节点还是从节点对话?只是为了防止故障转移时不一致,还是这里还有其他问题?
客户端应该如何(以及何时)检查它是连接到主实例还是从实例?是 运行
info replication
?
来自docs:
When the master node is rebooted, Azure Redis Cache fails over to the replica node and promotes it to master. During this failover, there may be a short interval in which connections may fail to the cache.
我的理解是你永远不会连接到奴隶,因为它永远不会暴露给你。如果 master 出去了,slave 会提升为 master,这就是你重新连接的。