灾难恢复和存储帐户故障转移Disaster recovery and storage account failover

Azure 致力于确保 Azure 服务一直可用。Azure strives to ensure that Azure services are always available. 不过,可能会发生计划外服务中断。However, unplanned service outages may occur. 如果应用程序需要复原能力,Azure 建议使用异地冗余存储,以便将数据复制到另一个区域。If your application requires resiliency, Azure recommends using geo-redundant storage, so that your data is copied to a second region. 此外,客户还应制定用于处理区域服务中断的灾难恢复计划。Additionally, customers should have a disaster recovery plan in place for handling a regional service outage. 灾难恢复计划的一个重要组成部分是,准备在主终结点不可用时将故障转移到辅助终结点。An important part of a disaster recovery plan is preparing to fail over to the secondary endpoint in the event that the primary endpoint becomes unavailable.

备注

本文进行了更新,以便使用新的 Azure PowerShell Az 模块。This article has been updated to use the new Azure PowerShell Az module. 你仍然可以使用 AzureRM 模块,至少在 2020 年 12 月之前,它将继续接收 bug 修补程序。You can still use the AzureRM module, which will continue to receive bug fixes until at least December 2020. 若要详细了解新的 Az 模块和 AzureRM 兼容性,请参阅新 Azure Powershell Az 模块简介To learn more about the new Az module and AzureRM compatibility, see Introducing the new Azure PowerShell Az module. 有关 Az 模块安装说明,请参阅安装 Azure PowerShellFor Az module installation instructions, see Install Azure PowerShell.

选择正确的冗余选项Choose the right redundancy option

Azure 存储将维护存储帐户的多个副本,以确保持续性和高可用性。Azure Storage maintains multiple copies of your storage account to ensure durability and high availability. 为帐户选择哪个冗余选项取决于所需的复原能力水平。Which redundancy option you choose for your account depends on the degree of resiliency you need. 为了防止区域中断,请为你的帐户配置异地冗余存储,无论是否选择从次要区域进行读取访问:For protection against regional outages, configure your account for geo-redundant storage, with or without the option of read access from the secondary region:

异地冗余存储 (GRS) 在至少相距数百英里的两个地理区域中异步复制数据。Geo-redundant storage (GRS) copies your data asynchronously in two geographic regions that are at least hundreds of miles apart. 如果主要区域遭遇服务中断,次要区域便会成为数据的冗余源。If the primary region suffers an outage, then the secondary region serves as a redundant source for your data. 可以通过启动故障转移,将辅助终结点转换为主终结点。You can initiate a failover to transform the secondary endpoint into the primary endpoint.

读取访问权限异地冗余存储 (RA-GRS) :为异地冗余存储提供附加优势,即对辅助终结点的读取访问权限。Read-access geo-redundant storage (RA-GRS) provides geo-redundant storage with the additional benefit of read access to the secondary endpoint. 如果主终结点发生中断,配置为对辅助终结点进行读取访问并设计为高度可用的应用程序可以继续从辅助终结点读取数据。If an outage occurs in the primary endpoint, applications configured for read access to the secondary and designed for high availability can continue to read from the secondary endpoint. Azure 建议使用 RA-GRS 来实现应用程序的最大可用性和持久性。Azure recommends RA-GRS for maximum vailability and durability for your applications.

有关 Azure 存储中冗余的详细信息,请参阅 Azure 存储冗余For more information about redundancy in Azure Storage, see Azure Storage redundancy.

警告

异地冗余存储有数据丢失风险。Geo-redundant storage carries a risk of data loss. 数据是异步复制到次要区域,这意味着数据写入主要区域与数据写入次要区域之间存在延迟。Data is copied to the secondary region asynchronously, meaning there is a delay between when data written to the primary region is written to the secondary region. 发生服务中断时,尚未复制到辅助终结点的对主终结点的写入操作将丢失。In the event of an outage, write operations to the primary endpoint that have not yet been copied to the secondary endpoint will be lost.

旨在实现高可用性Design for high availability

请务必从一开始就设计高可用性应用程序。It's important to design your application for high availability from the start. 有关设计应用程序和计划灾难恢复方面的指导,请参阅以下 Azure 资源:Refer to these Azure resources for guidance in designing your application and planning for disaster recovery:

此外,还请注意下面这些可保持 Azure 存储数据高可用性的最佳做法:Additionally, keep in mind these best practices for maintaining high availability for your Azure Storage data:

跟踪服务中断Track outages

客户可以订阅 Azure 服务运行状况仪表板,以跟踪 Azure 存储和其他 Azure 服务的运行状况和状态。Customers may subscribe to the Azure Service Health Dashboard to track the health and status of Azure Storage and other Azure services.

Azure 还建议将应用程序设计为可以应对可能出现的写入故障。Azure also recommends that you design your application to prepare for the possibility of write failures. 应用程序应公开写入故障,以提醒你主要区域可能存在服务中断。Your application should expose write failures in a way that alerts you to the possibility of an outage in the primary region.

Azure 托管的故障转移Azure-managed failover

在由于重大灾难而导致区域丢失的极端情况下,Azure 可能会启动区域故障转移。In extreme circumstances where a region is lost due to a significant disaster, Azure may initiate a regional failover. 在此情况下,不需要采取任何操作。In this case, no action on your part is required. 在 Azure 托管的故障转移完成之前,你对存储帐户不拥有写入访问权限。Until the Azure-managed failover has completed, you won't have write access to your storage account. 如果存储帐户已配置 RA-GRS,应用程序可以从次要区域读取数据。Your applications can read from the secondary region if your storage account is configured for RA-GRS.

另请参阅See also