Azure Cache for Redis 的高可用性High availability for Azure Cache for Redis

Azure Cache for Redis 具有内置的高可用性。Azure Cache for Redis has built-in high availability. 其高可用性体系结构的目标是确保托管的 Redis 实例正常运行,即使其基础虚拟机 (VM) 受计划内或计划外中断的影响。The goal of its high availability architecture is to ensure that your managed Redis instance is functioning even when its underlying virtual machines (VMs) are impacted by planned or unplanned outages. 它提供的可用性百分比率要远高于将 Redis 承载在单个 VM 上的情况。It delivers much greater percentage rates than what's attainable by hosting Redis on a single VM.

Azure Cache for Redis 使用多个称为“节点”的用于缓存的 VM 来实现高可用性。Azure Cache for Redis implements high availability by using multiple VMs, called nodes, for a cache. 它将这些节点配置为以协调的方式进行数据复制和故障转移。It configures these nodes such that data replication and failover happen in coordinated manners. 它还会协调维护操作,例如 Redis 软件修补。It also orchestrates maintenance operations such as Redis software patching. “标准”、“高级”和“企业”层级中提供了各种高可用性选项:Various high availability options are available in the Standard, Premium, and Enterprise tiers:

选项Option 说明Description 可用性Availability 标准Standard 高级Premium EnterpriseEnterprise
标准复制Standard replication 单个数据中心中具有自动故障转移功能的双节点复制配置Dual-node replicated configuration in a single datacenter with automatic failover 99.9%99.9% -

标准复制Standard replication

默认情况下,在“标准”或“高级”层级中,Azure Cache for Redis 在一对 Redis 服务器上运行。An Azure Cache for Redis in the Standard or Premium tier runs on a pair of Redis servers by default. 这两个服务器托管在专用 VM 上。The two servers are hosted on dedicated VMs. 开源 Redis 只允许一台服务器处理数据写入请求。Open-source Redis allows only one server to handle data write requests. 此服务器是主要节点,而另一服务器是副本。This server is the primary node, while the other replica. 预配服务器节点后,Azure Cache for Redis 可向其分配主要角色和副本角色。After it provisions the server nodes, Azure Cache for Redis assigns primary and replica roles to them. 主要节点通常负责为来自 Redis 客户端的写入和读取请求提供服务。The primary node usually is responsible for servicing write as well as read requests from Redis clients. 在执行写入操作时,它会向其内部内存提交一个新密钥和密钥更新,并立即回复客户端。On a write operation, it commits a new key and a key update to its internal memory and replies immediately to the client. 它以异步方式将操作转发给副本。It forwards the operation to the replica asynchronously.



通常,Redis 客户端会与 Redis 缓存中的主节点通信,以获取所有读取和写入请求。Normally, a Redis client communicates with the primary node in a Redis cache for all read and write requests. 某些 Redis 客户端可以配置为从副本节点进行读取。Certain Redis clients can be configured to read from the replica node.

如果 Redis 缓存中的主节点不可用,则副本会自动升级为新的主节点。If the primary node in a Redis cache is unavailable, the replica will promote itself to become the new primary automatically. 此过程称为故障转移。This process is called a failover. 副本会等待足够长的时间才去接管,以免出现主节点快速恢复的情况。The replica will wait for sufficiently long time before taking over in case that the primary node recovers quickly. 发生故障转移时,Azure Cache for Redis 会预配新的 VM,并将其作为副本节点加入到缓存中。When a failover happens, Azure Cache for Redis provisions a new VM and joins it to the cache as the replica node. 副本执行与主节点的完整数据同步,这样它就会有缓存数据的另一个副本。The replica performs a full data synchronization with the primary so that it has another copy of the cache data.

主节点在计划内维护活动(例如 Redis 软件或操作系统更新)中可能会停止服务。A primary node can go out of service as part of a planned maintenance activity such as Redis software or operating system update. 它还可能因为计划外事件(例如底层硬件、软件或网络故障)而停止工作。It also can stop working because of unplanned events such as failures in underlying hardware, software, or network. Azure Cache for Redis 的故障转移和修补提供了有关 Redis 故障转移类型的详细说明。Failover and patching for Azure Cache for Redis provides a detailed explanation on types of Redis failovers. Azure Cache for Redis 在其生存期内会经历许多故障转移。An Azure Cache for Redis will go through many failovers during its lifetime. 高可用性体系结构旨在使缓存中的这些更改对其客户端尽可能透明。The high availability architecture is designed to make these changes inside a cache as transparent to its clients as possible.


以下内容以预览版提供。The following is available as a preview.

此外,Azure Cache for Redis 在高级层中允许更多副本节点。In addition, Azure Cache for Redis allows additional replica nodes in the Premium tier. 可以为多副本缓存配置最多三个副本节点。A multi-replica cache can be configured with up to three replica nodes. 具有更多副本通常会提高复原能力,因为附加的节点会为主节点提供备份。Having more replicas generally improves resiliency because of the additional nodes backing up the primary. 即使有更多副本,Azure Cache for Redis 实例仍可能会受到数据中心级别或 AZ 级别的服务中断的严重影响。Even with more replicas, an Azure Cache for Redis instance still can be severely impacted by a datacenter- or AZ-level outage.

后续步骤Next steps

详细了解如何配置 Azure Cache for Redis 高可用性选项。Learn more about how to configure Azure Cache for Redis high-availability options.